From 3cd23eb517e4ce13a36ae8a6a177e382e9b0577f Mon Sep 17 00:00:00 2001 From: cquest Date: Fri, 24 Jan 2025 14:54:24 +0100 Subject: [PATCH] bug fix --- tootbot.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tootbot.py b/tootbot.py index 405717a..077b496 100755 --- a/tootbot.py +++ b/tootbot.py @@ -158,7 +158,7 @@ if source[:4] == 'http': print(len(d.entries)) for t in reversed(d.entries): # check if this tweet has been processed - if id in t: + if 'id' in t: id = t.id else: id = t.title @@ -169,7 +169,15 @@ if source[:4] == 'http': dt.tm_hour, dt.tm_min, dt.tm_sec) # process only unprocessed tweets less than 1 day old, after delay if last is None and age < timedelta(days=days) and age > timedelta(days=delay): - c = t.title + try: + alt = t.summary_detail.value + except: + alt = None + pass + + if 'title' in t: + c = t.title + if twitter and t.author.lower() != ('(@%s)' % twitter).lower(): c = ("RT https://twitter.com/%s\n" % t.author[2:-1]) + c toot_media = []