diff options
author | jwansek <eddie.atten.ea29@gmail.com> | 2023-10-17 10:41:23 +0000 |
---|---|---|
committer | jwansek <eddie.atten.ea29@gmail.com> | 2023-10-17 10:41:23 +0000 |
commit | 5deb277fd9d7403b0e6611dc214c3bde7819fb9a (patch) | |
tree | c9c13cc44ae7b77834fc92fb132ef2a02db1e10f | |
parent | 765f681cecfcd2ca0d0de5a3a44d30e7476277e6 (diff) | |
download | boymoder.blog-5deb277fd9d7403b0e6611dc214c3bde7819fb9a.tar.gz boymoder.blog-5deb277fd9d7403b0e6611dc214c3bde7819fb9a.zip |
Fixed bug with diary
-rw-r--r-- | database.py | 8 | ||||
-rwxr-xr-x | requirements.txt | 3 |
2 files changed, 6 insertions, 5 deletions
diff --git a/database.py b/database.py index f3a181c..d21ae37 100644 --- a/database.py +++ b/database.py @@ -233,7 +233,7 @@ class Database: with self.__connection.cursor() as cursor: # cursor.execute("SELECT tweet_id, tweeted_at, tweet FROM diary WHERE replying_to IS NULL ORDER BY tweeted_at DESC;") # attempt to ignore curiouscat automatic tweets by comparing with the q&a table - cursor.execute("SELECT tweet_id, tweeted_at, tweet FROM diary WHERE replying_to IS NULL AND tweet_id NOT IN (SELECT tweet_id FROM diary INNER JOIN qnas ON SUBSTRING(tweet, 1, 16) = SUBSTRING(question, 1, 16)) AND account = %s ORDER BY tweeted_at DESC;", (account, )) + cursor.execute("SELECT tweet_id, tweeted_at, tweet FROM diary WHERE replying_to IS NULL AND tweet_id NOT IN (SELECT tweet_id FROM diary INNER JOIN qnas ON SUBSTRING(tweet, 1, 16) = SUBSTRING(question, 1, 16)) AND account IN %s ORDER BY tweeted_at DESC;", ([account, "HONMISGENDERER"], )) for tweet_id, tweeted_at, tweet_text in cursor.fetchall(): # print(tweet_id, tweeted_at, tweet_text) out[tweeted_at] = [{ @@ -344,7 +344,7 @@ def update_cache(): if __name__ == "__main__": - #with Database() as db: - # print(db.get_cached_tweets(7)) + with Database() as db: + print(db.get_diary()) + - update_cache() diff --git a/requirements.txt b/requirements.txt index 534239e..0ce280b 100755 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,8 @@ itsdangerous==2.0.1 PyMySQL==1.0.2 python_qbittorrent==0.4.2 -Flask==2.1.0 +Werkzeug==2.3.7 +Flask==2.2.2 PiHole_api transmission-clutch dataclasses |