From a099e6cf153ae7155957bb16bc56233d2420288c Mon Sep 17 00:00:00 2001 From: clarkzjw Date: Mon, 20 Feb 2023 01:09:37 -0800 Subject: add mastodon.py example --- foursquare/__init__.py | 0 mastodon/__init__.py | 0 mastodon/toot.py | 21 +++++++++++++++++++++ requirements.txt | 9 +++++++++ 4 files changed, 30 insertions(+) create mode 100644 foursquare/__init__.py create mode 100644 mastodon/__init__.py create mode 100644 mastodon/toot.py diff --git a/foursquare/__init__.py b/foursquare/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/mastodon/__init__.py b/mastodon/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/mastodon/toot.py b/mastodon/toot.py new file mode 100644 index 0000000..2d07f0b --- /dev/null +++ b/mastodon/toot.py @@ -0,0 +1,21 @@ +from mastodon import Mastodon + +''' +https://mastodonpy.readthedocs.io/en/stable/index.html + +Mastodon.create_app( + 'pytooterapp', + api_base_url = 'https://mastodon.social', + to_file = 'pytooter_clientcred.secret' +) +''' + +# mastodon = Mastodon(client_id = 'pytooter_clientcred.secret',) +# mastodon.log_in( +# 'my_login_email@example.com', +# 'incrediblygoodpassword', +# to_file = 'pytooter_usercred.secret' +# ) + +mastodon = Mastodon(access_token = 'pytooter_usercred.secret') +mastodon.toot('Tooting from Python using #mastodonpy !') \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 33a4479..c031383 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,8 @@ anyio==3.6.2 +blurhash==1.1.4 certifi==2022.12.7 +charset-normalizer==3.0.1 +decorator==5.1.1 h11==0.14.0 h2==4.1.0 hpack==4.0.0 @@ -7,6 +10,12 @@ httpcore==0.16.3 httpx==0.23.3 hyperframe==6.0.1 idna==3.4 +Mastodon.py==1.8.0 +python-dateutil==2.8.2 +python-magic==0.4.27 python-telegram-bot==20.1 +requests==2.28.2 rfc3986==1.5.0 +six==1.16.0 sniffio==1.3.0 +urllib3==1.26.14 -- cgit v1.2.3