diff options
author | jwansek <eddie.atten.ea29@gmail.com> | 2023-03-02 16:44:41 +0000 |
---|---|---|
committer | jwansek <eddie.atten.ea29@gmail.com> | 2023-03-02 16:44:41 +0000 |
commit | 966fe80c956fec5dd2fb3ee27b488a8e1453eafa (patch) | |
tree | 9d02cbc3fc646a259d39f47a23267ea1456c6e98 | |
parent | a617a0fa5a47428b08a294ddda2bf9b2499c14de (diff) | |
download | eda.gay-966fe80c956fec5dd2fb3ee27b488a8e1453eafa.tar.gz eda.gay-966fe80c956fec5dd2fb3ee27b488a8e1453eafa.zip |
Updated fetching for the diary page, attempting to ignore automatic curiouscat tweets buy comparing the first 16 characters with the curiouscat table
-rwxr-xr-x | database.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/database.py b/database.py index 8829615..1a02cea 100755 --- a/database.py +++ b/database.py @@ -227,7 +227,9 @@ class Database: threading.Thread(target = update_cache).start() out = {} 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;") + # 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)) ORDER BY tweeted_at DESC;") for tweet_id, tweeted_at, tweet_text in cursor.fetchall(): # print(tweet_id, tweeted_at, tweet_text) out[tweeted_at] = [{ |