mirror of
https://gitlab.com/jeancf/twoot.git
synced 2025-02-25 01:18:41 +00:00
Compare commits
4 Commits
dba9e7d3ab
...
b6396f7b51
Author | SHA1 | Date | |
---|---|---|---|
|
b6396f7b51 | ||
|
a50a077cd3 | ||
|
4200c12204 | ||
|
8ddf85c0cf |
13
twoot.py
13
twoot.py
@ -598,7 +598,7 @@ def process_media_body(tt_iter):
|
||||
|
||||
tweet_text += url
|
||||
else:
|
||||
logging.warning("No handler for tag in twitter text: " + tag.prettify())
|
||||
logging.warning("No handler for tag %s in twitter text: ", tag.prettify())
|
||||
|
||||
return tweet_text
|
||||
|
||||
@ -954,7 +954,6 @@ def main(argv):
|
||||
# Select random nitter instance to fetch updates from
|
||||
nitter_url = 'https://' + TOML['options']['nitter_instances'][random.randint(0, len(TOML['options']['nitter_instances']) - 1)]
|
||||
|
||||
|
||||
# Load twitter page of user
|
||||
soup, timeline = get_timeline(nitter_url)
|
||||
|
||||
@ -1150,6 +1149,16 @@ def main(argv):
|
||||
if len(tweets) != 0 and mastodon is None:
|
||||
mastodon = login(mast_password)
|
||||
|
||||
# Check toot character limit on mastodon instance
|
||||
if mastodon is not None:
|
||||
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.
|
||||
# post each on Mastodon and record it in database
|
||||
|
Loading…
x
Reference in New Issue
Block a user