diff --git a/twoot.py b/twoot.py index e89b8f7..f0126c3 100755 --- a/twoot.py +++ b/twoot.py @@ -330,7 +330,9 @@ def is_time_valid(timestamp): return ret -def login(instance, account, password): +def login(password): + + instance = TOML['config']['mastodon_instance'] # Create Mastodon application if it does not exist yet if not os.path.isfile(instance + '.secret'): try: @@ -353,9 +355,9 @@ def login(instance, account, password): ) mastodon.log_in( - username=account, + username=TOML['options']['twitter_account'], password=password, - to_file=account + ".secret" + to_file=TOML['options']['twitter_account'] + ".secret" ) logging.info('Logging in to ' + instance) @@ -737,7 +739,7 @@ def main(argv): # Login to account on maston instance mastodon = None if len(tweets) != 0: - mastodon = login(TOML['config']['mastodon_instance'], TOML['config']['mastodon_user'], mast_password) + mastodon = login(mast_password) # ********************************************************** # Iterate tweets in list.