mirror of
https://gitlab.com/jeancf/twoot.git
synced 2024-11-27 14:01:13 +00:00
Update code added
This commit is contained in:
parent
bf0797a002
commit
5be406f765
13
twoot.py
13
twoot.py
|
@ -197,13 +197,24 @@ def update_profile(soup, db, mast_password):
|
|||
# Check if urls have changed
|
||||
if new_avatar_url == cur_avatar_url:
|
||||
new_avatar_url = None
|
||||
else:
|
||||
logging.info('avatar image changed on twitter profile')
|
||||
if new_banner_url == cur_banner_url:
|
||||
new_banner_url = None
|
||||
else:
|
||||
logging.info('banner image changed on twitter profile')
|
||||
|
||||
mastodon = None
|
||||
if new_avatar_url is not None or new_banner_url is not None:
|
||||
logging.info('updating profile on Mastodon')
|
||||
mastodon = login(mast_password)
|
||||
# TODO update profile on Mastodon
|
||||
# Update profile on Mastodon
|
||||
try:
|
||||
mastodon.account_update_credentials(avatar=new_avatar_url, header=new_banner_url)
|
||||
except Exception as e:
|
||||
logging.error("Could not update profile")
|
||||
logging.error(e)
|
||||
|
||||
# TODO update database
|
||||
|
||||
return mastodon
|
||||
|
|
Loading…
Reference in New Issue
Block a user