diff --git a/masto-mutuals.py b/masto-mutuals.py index c584f08..dafbeca 100644 --- a/masto-mutuals.py +++ b/masto-mutuals.py @@ -1,10 +1,17 @@ #!/usr/bin/python3 from mastodon import Mastodon +import configparser +import xdg.BaseDirectory + +config_file_path = '%s/masto-mutuals/config.txt' % xdg.BaseDirectory.xdg_config_home +config = configparser.ConfigParser() +config.read(config_file_path) +# TODO: if config file is empty, this should write defaults into a file. mastodon = Mastodon( - access_token = 'apptoken.secret', #app authtoken - api_base_url = 'https://lgbt.io' + access_token = config['ACCOUNT_DATA']['access_token'] + api_base_url = config['ACCOUNT_DATA']['instance_url'] ) user_id = mastodon.me()['id']