aboutsummaryrefslogtreecommitdiffstats
path: root/database.py
diff options
context:
space:
mode:
authorjwansek <eddie.atten.ea29@gmail.com>2023-03-02 16:44:41 +0000
committerjwansek <eddie.atten.ea29@gmail.com>2023-03-02 16:44:41 +0000
commit966fe80c956fec5dd2fb3ee27b488a8e1453eafa (patch)
tree9d02cbc3fc646a259d39f47a23267ea1456c6e98 /database.py
parenta617a0fa5a47428b08a294ddda2bf9b2499c14de (diff)
downloadboymoder.blog-966fe80c956fec5dd2fb3ee27b488a8e1453eafa.tar.gz
boymoder.blog-966fe80c956fec5dd2fb3ee27b488a8e1453eafa.zip
Updated fetching for the diary page, attempting to ignore automatic curiouscat tweets buy comparing the first 16 characters with the curiouscat table
Diffstat (limited to 'database.py')
-rwxr-xr-xdatabase.py4
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] = [{