mirror of
https://gitlab.com/jeancf/twoot.git
synced 2025-02-17 13:58:11 +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,
|
||||
'remove_link_redirections': False,
|
||||
'remove_trackers_from_urls': False,
|
||||
'footer': '',
|
||||
'tweet_max_age': float(1),
|
||||
'tweet_delay': float(0),
|
||||
'toot_cap': int(0),
|
||||
|
@ -125,7 +126,7 @@ def build_config(args):
|
|||
except KeyError: # Key was not found in file
|
||||
pass
|
||||
else:
|
||||
# Override config parameters with command-line values if provided
|
||||
# Override config parameters with command-line values provided
|
||||
if args['t'] is not None:
|
||||
TOML['config']['twitter_account'] = args['t']
|
||||
if args['i'] is not None:
|
||||
|
@ -761,8 +762,15 @@ def main(argv):
|
|||
if vid_in_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
|
||||
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
|
||||
# with "twitter:image" meta tag in first linked page in tweet text
|
||||
|
|
Loading…
Reference in New Issue
Block a user