From de87d7761b0c31e91baa8359008ace2e859a8053 Mon Sep 17 00:00:00 2001 From: Lynne Date: Sat, 17 Nov 2018 15:37:57 +1000 Subject: [PATCH] handle it for realsies now --- run.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/run.py b/run.py index 32771fc..e3b7ec3 100755 --- a/run.py +++ b/run.py @@ -51,10 +51,13 @@ for row in dc.fetchall(): posted = True toot = "Curious Cat user {} asks: {}\n\nMy answer: {}\n\nhttps://curiouscat.me/{}/post/{}".format(sender, post['comment'], post['reply'], row['cc'], post['id']) #TODO: what if this is over 500 characters? - if settings['cw']: - client.status_post(toot, spoiler_text="Curious Cat post") - else: - client.status_post(toot) + try: + if settings['cw']: + client.status_post(toot, spoiler_text="Curious Cat post") + else: + client.status_post(toot) + except: + continue c.execute("UPDATE data SET last_check = %s, time_between_checks = %s, latest_post = %s", (t, cfg['min_time_between_checks'], j['posts'][0]['timestamp'])) if not posted: #we checked, and they haven't made a post