diff options
Diffstat (limited to 'randombot.py')
-rwxr-xr-x | randombot.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/randombot.py b/randombot.py new file mode 100755 index 0000000..a5e58be --- /dev/null +++ b/randombot.py @@ -0,0 +1,11 @@ +from mastodon import Mastodon
+import random, os, pathlib
+
+mastodon = Mastodon(
+ access_token = 'abcdefg',
+ api_base_url = 'https://domain.com/'
+)
+
+facts = open(os.path.join(pathlib.Path(__file__).parent.absolute(), 'facts.txt')).read().splitlines()
+fact = random.choice(facts)
+mastodon.status_post(fact)
\ No newline at end of file |