mirror of
https://github.com/patrickbeane/quote-of-the-day.git
synced 2026-04-06 07:35:32 +00:00
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.
This commit is contained in:
25
add-quotes.py
Normal file
25
add-quotes.py
Normal file
@@ -0,0 +1,25 @@
|
||||
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()
|
||||
Reference in New Issue
Block a user