mirror of
https://gitlab.com/jeancf/twoot.git
synced 2024-11-23 20:11:11 +00:00
Get max_characters from instance
This commit is contained in:
parent
8ddf85c0cf
commit
4200c12204
10
twoot.py
10
twoot.py
|
@ -1151,9 +1151,13 @@ def main(argv):
|
|||
mastodon = login(mast_password)
|
||||
|
||||
# Check toot character limit on mastodon instance
|
||||
mast_statuses = mastodon.instance().configuration.statuses
|
||||
logging.debug('Instance configuration:')
|
||||
logging.debug(mast_statuses)
|
||||
try:
|
||||
max_characters = mastodon.instance().configuration.statuses['max_characters']
|
||||
logging.debug('Instance character limit is '+ str(max_characters))
|
||||
except Exception:
|
||||
# Default value for Mastodon
|
||||
max_characters = 500
|
||||
logging.debug('Tried to get toot character limit from Mastodon instance but failed. Assuming 500')
|
||||
|
||||
# **********************************************************
|
||||
# Iterate tweets in list.
|
||||
|
|
Loading…
Reference in New Issue
Block a user