romeotools/worker.py

19 lines
344 B
Python
Raw Permalink Normal View History

2022-09-08 12:32:31 +00:00
import json
import datetime
import sqlite3
from classes.database import Database
from classes.api import RomeoAPI
try:
from settings import USERNAME, PASSWORD
except:
USERNAME, PASSWORD = None, None
api = RomeoAPI(True, USERNAME, PASSWORD)
db = Database()
db.create_tables()
for message in api.messages():
message.to_database()