mirror of
https://gitlab.com/jeancf/twoot.git
synced 2025-02-25 09:28:43 +00:00
Compare commits
No commits in common. "b6396f7b515fba3eaf3eaef49017605067b61233" and "dba9e7d3aba77ddc9ec266b727212bdbd67fff55" have entirely different histories.
b6396f7b51
...
dba9e7d3ab
15
twoot.py
15
twoot.py
@ -598,7 +598,7 @@ def process_media_body(tt_iter):
|
|||||||
|
|
||||||
tweet_text += url
|
tweet_text += url
|
||||||
else:
|
else:
|
||||||
logging.warning("No handler for tag %s in twitter text: ", tag.prettify())
|
logging.warning("No handler for tag in twitter text: " + tag.prettify())
|
||||||
|
|
||||||
return tweet_text
|
return tweet_text
|
||||||
|
|
||||||
@ -954,6 +954,7 @@ def main(argv):
|
|||||||
# Select random nitter instance to fetch updates from
|
# Select random nitter instance to fetch updates from
|
||||||
nitter_url = 'https://' + TOML['options']['nitter_instances'][random.randint(0, len(TOML['options']['nitter_instances']) - 1)]
|
nitter_url = 'https://' + TOML['options']['nitter_instances'][random.randint(0, len(TOML['options']['nitter_instances']) - 1)]
|
||||||
|
|
||||||
|
|
||||||
# Load twitter page of user
|
# Load twitter page of user
|
||||||
soup, timeline = get_timeline(nitter_url)
|
soup, timeline = get_timeline(nitter_url)
|
||||||
|
|
||||||
@ -1043,7 +1044,7 @@ def main(argv):
|
|||||||
if quote_div is not None:
|
if quote_div is not None:
|
||||||
tweet_text += substitute_source('\n\nhttps://twitter.com' + quote_div.get('href').strip('#m'))
|
tweet_text += substitute_source('\n\nhttps://twitter.com' + quote_div.get('href').strip('#m'))
|
||||||
|
|
||||||
# Process card: extract image if necessary
|
# Process card : extract image if necessary
|
||||||
card_class = status.find('a', class_='card-container')
|
card_class = status.find('a', class_='card-container')
|
||||||
if card_class is not None:
|
if card_class is not None:
|
||||||
photos.extend(process_card(nitter_url, card_class))
|
photos.extend(process_card(nitter_url, card_class))
|
||||||
@ -1149,16 +1150,6 @@ def main(argv):
|
|||||||
if len(tweets) != 0 and mastodon is None:
|
if len(tweets) != 0 and mastodon is None:
|
||||||
mastodon = login(mast_password)
|
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.
|
# Iterate tweets in list.
|
||||||
# post each on Mastodon and record it in database
|
# post each on Mastodon and record it in database
|
||||||
|
Loading…
x
Reference in New Issue
Block a user