diff --git a/.DS_Store b/.DS_Store index 41085eb..d0c132b 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/answers_mastodonapi.py b/answers_mastodonapi.py index 5ed729f..80bd09a 100644 --- a/answers_mastodonapi.py +++ b/answers_mastodonapi.py @@ -32,7 +32,15 @@ with open('token.txt', 'r') as token: mastodon = Mastodon(access_token=token_line.replace('\n', ''), api_base_url=(str(base_url))) toot_id_current = toot_id[n] - print(toot_id_current) + description = mastodon.instance()['description'] + + #print instance name and description + pprint("Instance:" + "\n" + str(base_url) + "\n" + "\n") + pprint("Description:" + "\n" + str(description) + "\n" + "\n") + + text_file.write("

" + str(base_url) + "

" + "\n" + "\n") + text_file.write("

" + str(description) + "

" + "\n" + "\n") + status = mastodon.status_context(id=(toot_id_current)) descendants = mastodon.status_context(id=(toot_id_current))["descendants"] print(toot_id_current) @@ -42,16 +50,16 @@ with open('token.txt', 'r') as token: avatar = mastodon.status(answer["id"])['account']['avatar'] name = mastodon.status(answer["id"])['account']['display_name'] bot = mastodon.status(answer["id"])['account']['bot'] - content = mastodon.status(answer["id"])['content'] + toot = mastodon.status(answer["id"])['content'] + + text_file.write("" + "\n" + "\n") + text_file.write("

" + str(name) + "

" + "\n" + "\n") + text_file.write("

" + "Bot: " + str(bot) + "

" + "\n" + "\n") + text_file.write("

" + "\n" + str(toot) + "" + "\n" + "\n") pprint("Avatar:" + "\n" + str(avatar) + "\n" + "\n") pprint("Name:" + "\n" + str(name) + "\n" + "\n") pprint("Bot:" + "\n" + str(bot) + "\n" + "\n") - pprint("Content:" + "\n" + str(content) + "\n" + "\n") - - text_file.write("Avatar:" + "\n" + str(avatar) + "\n" + "\n") - text_file.write("Name:" + "\n" + str(name) + "\n" + "\n") - text_file.write("Bot:" + "\n" + str(bot) + "\n" + "\n") - text_file.write("Content:" + "\n" + str(content) + "\n" + "\n" + "\n") + pprint("Content:" + "\n" + str(toot) + "\n" + "\n" + "\n") time.sleep(2)