commit bf803e2d440e3577f095da0e28b00dc56b833af7 Author: Pedro Sá Couto Date: Tue Mar 19 14:35:19 2019 +0100 first script, token has to be on folder diff --git a/answers_mastodonapi.py b/answers_mastodonapi.py new file mode 100644 index 0000000..d6217be --- /dev/null +++ b/answers_mastodonapi.py @@ -0,0 +1,24 @@ +from mastodon import Mastodon +from pprint import pprint +import time +import datetime + +with open('token.txt','r') as token: + print(token.read()) + mastodon = Mastodon(access_token=token.read(),api_base_url="https://todon.nl") + + +descendants = mastodon.status_context(id=101767654564328802)["descendants"] + +for answer in descendants: + pprint(answer["id"]) + #geral = mastodon.status(answer["id"])) + 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'] + 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") + time.sleep(3)