kopia lustrzana https://github.com/halcy/Mastodon.py
Clean docs up a bit more
rodzic
396a2d442f
commit
ee9a3c9c5e
|
@ -23,15 +23,8 @@ Then login. This can be done every time, or you can use the persisted informatio
|
||||||
|
|
||||||
from mastodon import Mastodon
|
from mastodon import Mastodon
|
||||||
|
|
||||||
mastodon = Mastodon(
|
mastodon = Mastodon(client_id = 'pytooter_clientcred.secret',)
|
||||||
client_id = 'pytooter_clientcred.secret',
|
mastodon.log_in('my_login_email@example.com', 'incrediblygoodpassword', to_file = 'pytooter_usercred.secret')
|
||||||
api_base_url = 'https://mastodon.social'
|
|
||||||
)
|
|
||||||
mastodon.log_in(
|
|
||||||
'my_login_email@example.com',
|
|
||||||
'incrediblygoodpassword',
|
|
||||||
to_file = 'pytooter_usercred.secret'
|
|
||||||
)
|
|
||||||
|
|
||||||
To post, create an actual API instance:
|
To post, create an actual API instance:
|
||||||
|
|
||||||
|
@ -39,19 +32,13 @@ To post, create an actual API instance:
|
||||||
|
|
||||||
from mastodon import Mastodon
|
from mastodon import Mastodon
|
||||||
|
|
||||||
mastodon = Mastodon(
|
mastodon = Mastodon(access_token = 'pytooter_usercred.secret')
|
||||||
access_token = 'pytooter_usercred.secret',
|
|
||||||
api_base_url = 'https://mastodon.social'
|
|
||||||
)
|
|
||||||
mastodon.toot('Tooting from Python using #mastodonpy !')
|
mastodon.toot('Tooting from Python using #mastodonpy !')
|
||||||
|
|
||||||
`Mastodon`_ is an ActivityPub-based Twitter-like federated social
|
`Mastodon`_ is an ActivityPub-based Twitter-like federated social
|
||||||
network node. It has an API that allows you to interact with its
|
network node. It has an API that allows you to interact with its
|
||||||
every aspect. This is a simple Python wrapper for that API, provided
|
every aspect. This is a simple Python wrapper for that API, provided
|
||||||
as a single Python module. By default, it talks to the
|
as a single Python module.
|
||||||
`Mastodon flagship instance`_, but it can be set to talk to any
|
|
||||||
node running Mastodon by setting `api_base_url` when creating the
|
|
||||||
API object (or creating an app).
|
|
||||||
|
|
||||||
Mastodon.py aims to implement the complete public Mastodon API. As
|
Mastodon.py aims to implement the complete public Mastodon API. As
|
||||||
of this time, it is feature complete for Mastodon version 3.5.0. The
|
of this time, it is feature complete for Mastodon version 3.5.0. The
|
||||||
|
@ -1030,6 +1017,7 @@ Reading data: Instances
|
||||||
These functions allow you to fetch information associated with the
|
These functions allow you to fetch information associated with the
|
||||||
current instance.
|
current instance.
|
||||||
|
|
||||||
|
.. _instance():
|
||||||
.. automethod:: Mastodon.instance
|
.. automethod:: Mastodon.instance
|
||||||
.. automethod:: Mastodon.instance_activity
|
.. automethod:: Mastodon.instance_activity
|
||||||
.. automethod:: Mastodon.instance_peers
|
.. automethod:: Mastodon.instance_peers
|
||||||
|
@ -1159,8 +1147,11 @@ Reading data: Searching
|
||||||
Reading data: Trends
|
Reading data: Trends
|
||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
|
.. _trending_tags():
|
||||||
.. automethod:: Mastodon.trending_tags
|
.. automethod:: Mastodon.trending_tags
|
||||||
|
.. _trending_statuses():
|
||||||
.. automethod:: Mastodon.trending_statuses
|
.. automethod:: Mastodon.trending_statuses
|
||||||
|
.. _trending_links():
|
||||||
.. automethod:: Mastodon.trending_links
|
.. automethod:: Mastodon.trending_links
|
||||||
.. automethod:: Mastodon.trends
|
.. automethod:: Mastodon.trends
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue