From ba9b697a6325a58050143e9024e56542dc54d8ac Mon Sep 17 00:00:00 2001 From: Lynne Date: Thu, 15 Nov 2018 11:09:47 +1000 Subject: [PATCH] don't get tripped up by errors --- run.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/run.py b/run.py index ce4ed4a..6003e30 100755 --- a/run.py +++ b/run.py @@ -28,6 +28,8 @@ for row in dc.fetchall(): if row['cc'] != "None" and row['cc'] != None: r = requests.get("https://curiouscat.me/api/v2/profile?username={}&count=100&min_timestamp={}".format(row['cc'], row['latest_post'])) j = r.json() + if 'error' in j: + continue if len(j['posts']) > 0 and not (len(j['posts']) == 1 and int(j['posts'][0]['timestamp']) == int(row['latest_post'])): #they've made some new posts, log in to masto client = Mastodon(client_id=row['client_id'], client_secret=row['client_secret'], access_token=row['secret'], api_base_url=row['instance'])