kopia lustrzana https://github.com/halcy/Mastodon.py
Update README.rst
rodzic
062cc69343
commit
108d51cbd6
21
README.rst
21
README.rst
|
@ -18,22 +18,14 @@ Feature complete for public API as of Mastodon version 3.5.5 and easy to get sta
|
||||||
)
|
)
|
||||||
'''
|
'''
|
||||||
|
|
||||||
# Then, log in. This can be done every time your application starts (e.g. when writing a
|
# Then, log in. This can be done every time your application starts, or you can use the persisted information:
|
||||||
# simple bot), or you can use the persisted information:
|
|
||||||
mastodon = Mastodon(client_id = 'pytooter_clientcred.secret',)
|
mastodon = Mastodon(client_id = 'pytooter_clientcred.secret',)
|
||||||
mastodon.log_in(
|
print(mastodon.auth_request_url())
|
||||||
'my_login_email@example.com',
|
|
||||||
'incrediblygoodpassword',
|
|
||||||
to_file = 'pytooter_usercred.secret'
|
|
||||||
)
|
|
||||||
|
|
||||||
# If you are logging in for the first time you need to give permissions to the app
|
# open the URL in the browser and paste the code you get
|
||||||
# via OAuth, at the URL given by auth_request_url() and then pass code instead of
|
|
||||||
# username and password.
|
|
||||||
mastodon.log_in(
|
mastodon.log_in(
|
||||||
to_file = 'pytooter_usercred.secret',
|
code=input("Enter the OAuth authorization code: "),
|
||||||
code='code_from_oauth,
|
to_file="pytooter_usercred.secret"
|
||||||
scopes=['read', 'write'],
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Note that this won't work when using 2FA - you'll have to use OAuth, in that case.
|
# Note that this won't work when using 2FA - you'll have to use OAuth, in that case.
|
||||||
|
@ -45,8 +37,7 @@ You can install Mastodon.py via pypi:
|
||||||
|
|
||||||
.. code-block:: Bash
|
.. code-block:: Bash
|
||||||
|
|
||||||
# Python 3
|
pip install Mastodon.py
|
||||||
pip3 install Mastodon.py
|
|
||||||
|
|
||||||
We currently try to support Python 3.7 and above, and try to at least not break Python 3 versions
|
We currently try to support Python 3.7 and above, and try to at least not break Python 3 versions
|
||||||
below that. Python 2 support is no longer a goal.
|
below that. Python 2 support is no longer a goal.
|
||||||
|
|
Ładowanie…
Reference in New Issue