forgot some details in the post
This commit is contained in:
@ -19,7 +19,10 @@ if unsplash_result.reason == 'OK':
|
|||||||
upload_result = post(media_endpoint, headers=puppy_hdr, data=payload, files=file)
|
upload_result = post(media_endpoint, headers=puppy_hdr, data=payload, files=file)
|
||||||
if upload_result.reason == 'OK':
|
if upload_result.reason == 'OK':
|
||||||
uploaded = DefaultMunch.fromDict(loads(upload_result.text))
|
uploaded = DefaultMunch.fromDict(loads(upload_result.text))
|
||||||
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]}
|
status_record = {'spoiler_text': 'Random puppy image courtesy of Unplash.com',
|
||||||
|
'status': f"{picture_details.description or picture_details.alt_description}\n({picture_details.user.name} - {picture_details.links.html})\n\n{puppy_tags}\n and because unsplash photos don\'t always have it ... #AltText4Me",
|
||||||
|
'visibility': 'public',
|
||||||
|
'media_ids[]': [uploaded.id]}
|
||||||
post_result = post(post_endpoint, headers=puppy_hdr, data=status_record)
|
post_result = post(post_endpoint, headers=puppy_hdr, data=status_record)
|
||||||
if post_result.reason == 'OK':
|
if post_result.reason == 'OK':
|
||||||
notify(-1, 'puppybot: ' + loads(post_result.text)['url'])
|
notify(-1, 'puppybot: ' + loads(post_result.text)['url'])
|
||||||
|
Reference in New Issue
Block a user