don't get tripped up by errors
This commit is contained in:
parent
f685f76ccb
commit
ba9b697a63
1 changed files with 2 additions and 0 deletions
2
run.py
2
run.py
|
@ -28,6 +28,8 @@ for row in dc.fetchall():
|
||||||
if row['cc'] != "None" and row['cc'] != None:
|
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']))
|
r = requests.get("https://curiouscat.me/api/v2/profile?username={}&count=100&min_timestamp={}".format(row['cc'], row['latest_post']))
|
||||||
j = r.json()
|
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'])):
|
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
|
#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'])
|
client = Mastodon(client_id=row['client_id'], client_secret=row['client_secret'], access_token=row['secret'], api_base_url=row['instance'])
|
||||||
|
|
Loading…
Reference in a new issue