puppybot workflow
This commit is contained in:
@ -22,10 +22,10 @@ if unsplash_result.reason == 'OK':
|
||||
status_record = {'spoiler_text': 'Random puppy image courtesy of Unplash.com', 'status': f"{picture_details.description or picture_details.alt_description}\n\n{puppy_tags}", 'visibility': 'public', 'media_ids[]': [uploaded.id]}
|
||||
post_result = post(post_endpoint, headers=puppy_hdr, data=status_record)
|
||||
if post_result.reason == 'OK':
|
||||
print(loads(post_result.text)['url'])
|
||||
notify(-1, 'puppybot: ' + loads(post_result.text)['url'])
|
||||
else:
|
||||
print('Something went wrong; ' + post_result.reason)
|
||||
notify(0, 'Status update did not go through; ' + post_result.reason)
|
||||
else:
|
||||
print('Upload did not go thru; ' + upload_result.reason)
|
||||
notify(0, 'Upload did not go through; ' + upload_result.reason)
|
||||
else:
|
||||
print('Unsplash api not cooperating; ' + unsplash_result.reason)
|
||||
notify(0, 'Unsplash api call did not go through; ' + unsplash_result.reason)
|
||||
|
Reference in New Issue
Block a user