mirror of
https://gitlab.com/jeancf/twoot.git
synced 2025-03-27 16:06:46 +00:00
Renamed substitution keys
This commit is contained in:
parent
d1b23e5c0d
commit
30773933f2
12
twoot.py
12
twoot.py
@ -258,19 +258,19 @@ def substitute_source(orig_url):
|
||||
logging.debug("Checking domain %s for substitution ", domain)
|
||||
|
||||
# Handle twitter
|
||||
twitter_subst = TOML["options"]["substitution"]["twitter"]
|
||||
twitter_subst = TOML["options"]["subst_twitter"]
|
||||
if domain.find('twitter.com') >=0 and twitter_subst != []:
|
||||
domain = twitter_subst[random.randint(0, len(twitter_subst) - 1)]
|
||||
logging.debug("Replaced twitter.com by " + domain)
|
||||
|
||||
# Handle youtube
|
||||
youtube_subst = TOML["options"]["substitution"]["youtube"]
|
||||
youtube_subst = TOML["options"]["subst_youtube"]
|
||||
if domain.find('youtube.com') >=0 and youtube_subst != []:
|
||||
domain = youtube_subst[random.randint(0, len(youtube_subst) - 1)]
|
||||
logging.debug("Replaced youtube.com by " + domain)
|
||||
|
||||
# Handle reddit
|
||||
reddit_subst = TOML["options"]["substitution"]["reddit"]
|
||||
reddit_subst = TOML["options"]["subst_reddit"]
|
||||
if domain.find('reddit.com') >=0 and reddit_subst != []:
|
||||
domain = reddit_subst[random.randint(0, len(reddit_subst) - 1)]
|
||||
logging.debug("Replaced reddit.com by " + domain)
|
||||
@ -568,9 +568,9 @@ def main(argv):
|
||||
logging.info(' tweet_max_age : ' + str(TOML['options']['tweet_max_age']))
|
||||
logging.info(' tweet_delay : ' + str(TOML['options']['tweet_delay']))
|
||||
logging.info(' toot_cap : ' + str(TOML['options']['toot_cap']))
|
||||
logging.info(' twitter substitution : ' + str(TOML['options']['substitution']['twitter']))
|
||||
logging.info(' youtube substitution : ' + str(TOML['options']['substitution']['youtube']))
|
||||
logging.info(' reddit substitution : ' + str(TOML['options']['substitution']['reddit']))
|
||||
logging.info(' twitter substitution : ' + str(TOML['options']['subst_twitter']))
|
||||
logging.info(' youtube substitution : ' + str(TOML['options']['subst_youtube']))
|
||||
logging.info(' reddit substitution : ' + str(TOML['options']['subst_reddit']))
|
||||
|
||||
# Try to open database. If it does not exist, create it
|
||||
sql = sqlite3.connect('twoot.db')
|
||||
|
Loading…
x
Reference in New Issue
Block a user