mirror of
https://gitlab.com/jeancf/twoot.git
synced 2025-05-25 02:05:48 +00:00
Added footer functionality
This commit is contained in:
parent
84ee69c4db
commit
f1d947d83c
12
twoot.py
12
twoot.py
@ -86,6 +86,7 @@ def build_config(args):
|
|||||||
'skip_retweets': False,
|
'skip_retweets': False,
|
||||||
'remove_link_redirections': False,
|
'remove_link_redirections': False,
|
||||||
'remove_trackers_from_urls': False,
|
'remove_trackers_from_urls': False,
|
||||||
|
'footer': '',
|
||||||
'tweet_max_age': float(1),
|
'tweet_max_age': float(1),
|
||||||
'tweet_delay': float(0),
|
'tweet_delay': float(0),
|
||||||
'toot_cap': int(0),
|
'toot_cap': int(0),
|
||||||
@ -125,7 +126,7 @@ def build_config(args):
|
|||||||
except KeyError: # Key was not found in file
|
except KeyError: # Key was not found in file
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
# Override config parameters with command-line values if provided
|
# Override config parameters with command-line values provided
|
||||||
if args['t'] is not None:
|
if args['t'] is not None:
|
||||||
TOML['config']['twitter_account'] = args['t']
|
TOML['config']['twitter_account'] = args['t']
|
||||||
if args['i'] is not None:
|
if args['i'] is not None:
|
||||||
@ -761,8 +762,15 @@ def main(argv):
|
|||||||
if vid_in_tweet:
|
if vid_in_tweet:
|
||||||
tweet_text += '\n\n[Video embedded in original tweet]'
|
tweet_text += '\n\n[Video embedded in original tweet]'
|
||||||
|
|
||||||
|
# Add custom footer from config file
|
||||||
|
if TOML['options']['footer'] != '':
|
||||||
|
tweet_text += '\n\n' + TOML['options']['footer']
|
||||||
|
|
||||||
# Add footer with link to original tweet
|
# Add footer with link to original tweet
|
||||||
tweet_text += '\n\nOriginal tweet : ' + substitute_source(full_status_url)
|
if TOML['options']['footer'] != '':
|
||||||
|
tweet_text += '\nOriginal tweet : ' + substitute_source(full_status_url)
|
||||||
|
else:
|
||||||
|
tweet_text += '\n\nOriginal tweet : ' + substitute_source(full_status_url)
|
||||||
|
|
||||||
# If no media was specifically added in the tweet, try to get the first picture
|
# If no media was specifically added in the tweet, try to get the first picture
|
||||||
# with "twitter:image" meta tag in first linked page in tweet text
|
# with "twitter:image" meta tag in first linked page in tweet text
|
||||||
|
Loading…
x
Reference in New Issue
Block a user