aboutsummaryrefslogtreecommitdiff
blob: 659d232f76a398531b883bc198f50bfd586cf428 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from mastodon import Mastodon

from config import TOOT_API_BASE_URL, TOOT_CLIENT_SECRET, TOOT_ACCESS_TOKEN, TOOT_CLIENT_ID, MASTODON_CLIENT_ID_FILE

'''
https://mastodonpy.readthedocs.io/en/stable/index.html
'''

mastodon_client = Mastodon(client_id=MASTODON_CLIENT_ID_FILE,
                           api_base_url=TOOT_API_BASE_URL)

url = mastodon_client.auth_request_url(redirect_uris="https://zjw.social/checkinbot/fedi_login_callback", scopes=['write:media', 'write:statuses'])
print(url)

# mastodon_client.log_in(
#     username="[email protected]",
#     code='2RnDpj9lMGLWuIeppl-Cghy-iwSXzlJFWU6mQaKYD9o',
#     # redirect_uri="urn:ietf:wg:oauth:2.0:oob",
#     scopes=['write:media', 'write:statuses']
# )
Powered by cgit v1.2.3 (git 2.41.0)