Files
quote-of-the-day/add-quotes.py
patrickbeane ddf5e983e2 Initial commit: Quote of the Day API
Secure, rate‑limited Flask + Gunicorn microservice with SQLite persistence, delivery tracking, and systemd deployment config. Includes setup script, HTML template, and production‑ready README.
2025-08-30 13:24:33 -04:00

26 lines
643 B
Python

import sqlite3
conn = sqlite3.connect("quotes.db")
c = conn.cursor()
quotes = [
("Strive not to be a success, but rather to be of value.", "Albert Einstein"),
("I find that the harder I work, the more luck I seem to have.", "Thomas Jefferson")
]
c.execute("""
CREATE TABLE IF NOT EXISTS quotes (
id INTEGER PRIMARY KEY AUTOINCREMENT,
quote TEXT NOT NULL,
author TEXT NOT NULL,
delivered INTEGER DEFAULT 0
)
""")
conn.commit()
for quote, author in quotes:
c.execute("INSERT INTO quotes (quote, author) VALUES (?, ?)", (quote, author))
conn.commit()
conn.close()