diff options
author | clarkzjw <[email protected]> | 2023-02-20 01:09:37 -0800 |
---|---|---|
committer | clarkzjw <[email protected]> | 2023-02-20 01:09:37 -0800 |
commit | a099e6cf153ae7155957bb16bc56233d2420288c (patch) | |
tree | 2a86fabdc69cb178b6962955a53a4d6499ee5185 | |
parent | 76597b5c619649c2457cb876a2c749e9c7a4a248 (diff) | |
download | swarm2fediverse-a099e6cf153ae7155957bb16bc56233d2420288c.tar.gz |
add mastodon.py example
-rw-r--r-- | foursquare/__init__.py | 0 | ||||
-rw-r--r-- | mastodon/__init__.py | 0 | ||||
-rw-r--r-- | mastodon/toot.py | 21 | ||||
-rw-r--r-- | requirements.txt | 9 |
4 files changed, 30 insertions, 0 deletions
diff --git a/foursquare/__init__.py b/foursquare/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/foursquare/__init__.py | |||
diff --git a/mastodon/__init__.py b/mastodon/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/mastodon/__init__.py | |||
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 @@ | |||
1 | from mastodon import Mastodon | ||
2 | |||
3 | ''' | ||
4 | https://mastodonpy.readthedocs.io/en/stable/index.html | ||
5 | |||
6 | Mastodon.create_app( | ||
7 | 'pytooterapp', | ||
8 | api_base_url = 'https://mastodon.social', | ||
9 | to_file = 'pytooter_clientcred.secret' | ||
10 | ) | ||
11 | ''' | ||
12 | |||
13 | # mastodon = Mastodon(client_id = 'pytooter_clientcred.secret',) | ||
14 | # mastodon.log_in( | ||
15 | # '[email protected]', | ||
16 | # 'incrediblygoodpassword', | ||
17 | # to_file = 'pytooter_usercred.secret' | ||
18 | # ) | ||
19 | |||
20 | mastodon = Mastodon(access_token = 'pytooter_usercred.secret') | ||
21 | 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 @@ | |||
1 | anyio==3.6.2 | 1 | anyio==3.6.2 |
2 | blurhash==1.1.4 | ||
2 | certifi==2022.12.7 | 3 | certifi==2022.12.7 |
4 | charset-normalizer==3.0.1 | ||
5 | decorator==5.1.1 | ||
3 | h11==0.14.0 | 6 | h11==0.14.0 |
4 | h2==4.1.0 | 7 | h2==4.1.0 |
5 | hpack==4.0.0 | 8 | hpack==4.0.0 |
@@ -7,6 +10,12 @@ httpcore==0.16.3 | |||
7 | httpx==0.23.3 | 10 | httpx==0.23.3 |
8 | hyperframe==6.0.1 | 11 | hyperframe==6.0.1 |
9 | idna==3.4 | 12 | idna==3.4 |
13 | Mastodon.py==1.8.0 | ||
14 | python-dateutil==2.8.2 | ||
15 | python-magic==0.4.27 | ||
10 | python-telegram-bot==20.1 | 16 | python-telegram-bot==20.1 |
17 | requests==2.28.2 | ||
11 | rfc3986==1.5.0 | 18 | rfc3986==1.5.0 |
19 | six==1.16.0 | ||
12 | sniffio==1.3.0 | 20 | sniffio==1.3.0 |
21 | urllib3==1.26.14 | ||