from mastodon import Mastodon import config def register_app(): Mastodon.create_app( config.APP_NAME, website=config.APP_WEBSITE, api_base_url=config.APP_INSTANCE_URL, to_file='secrets.txt') app = Mastodon(client_id='secrets.txt') print("Browse to the OAuth authorization page at") print(app.auth_request_url()) app.log_in( code=input("and paste here the OAuth authorization code: "), to_file='secrets.txt') print("Registration complete") if __name__=='__main__': register_app()