From 7af034a479e5fae0ba90d9091842183feb42eb58 Mon Sep 17 00:00:00 2001 From: cquest Date: Fri, 24 Jan 2025 14:54:56 +0100 Subject: [PATCH] search toot by id or title --- tootbot.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tootbot.py b/tootbot.py index 077b496..abdb3f6 100755 --- a/tootbot.py +++ b/tootbot.py @@ -162,7 +162,9 @@ if source[:4] == 'http': id = t.id else: id = t.title - db.execute('SELECT * FROM tweets WHERE tweet = ? AND twitter = ? and mastodon = ? and instance = ?', (id, source, mastodon, instance)) # noqa + + db.execute('SELECT * FROM tweets WHERE (tweet = ? or tweet = ?) AND twitter = ? and mastodon = ? and instance = ?', # noqa + (id, t.link, source, mastodon, instance)) last = db.fetchone() dt = t.published_parsed age = datetime.now()-datetime(dt.tm_year, dt.tm_mon, dt.tm_mday,