From b163d3e11521ad687d38c8142b9807e09879ef0a Mon Sep 17 00:00:00 2001 From: cquest Date: Mon, 2 May 2022 16:05:47 +0200 Subject: [PATCH] use title when no id is available --- tootbot.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tootbot.py b/tootbot.py index 053e4f8..e661d95 100755 --- a/tootbot.py +++ b/tootbot.py @@ -54,7 +54,11 @@ else: for t in reversed(d.entries): # check if this tweet has been processed - db.execute('SELECT * FROM tweets WHERE tweet = ? AND twitter = ? and mastodon = ? and instance = ?', (t.id, source, mastodon, instance)) # noqa + if id in t: + 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 last = db.fetchone() dt = t.published_parsed age = datetime.now()-datetime(dt.tm_year, dt.tm_mon, dt.tm_mday,