Fix some nits
This commit is contained in:
parent
43c7d7ceb8
commit
1704965f6d
@ -123,6 +123,16 @@ you can also just write
|
|||||||
|
|
||||||
and everything will work as intended.
|
and everything will work as intended.
|
||||||
|
|
||||||
|
Snowflake IDs
|
||||||
|
~~~~~~~~~~~~~
|
||||||
|
Some IDs in Mastodon (such as those for statuses) are Snowflake IDs. These broadly
|
||||||
|
correspond to times, with a low resolution, so it is possible to convert a time to
|
||||||
|
a Snowflake ID and search for posts between two dates. Mastodon.py will do the
|
||||||
|
conversion for you automatically when you pass a `datetime` object as the id.
|
||||||
|
|
||||||
|
Note that this functionality will *not* work on anything but Mastodon and forks,
|
||||||
|
and that it is somewhat inexact due to the relatively low resolution.
|
||||||
|
|
||||||
Versioning
|
Versioning
|
||||||
----------
|
----------
|
||||||
Mastodon.py will check if a certain endpoint is available before doing API
|
Mastodon.py will check if a certain endpoint is available before doing API
|
||||||
|
@ -3,6 +3,8 @@ Mastodon.py
|
|||||||
.. py:module:: mastodon
|
.. py:module:: mastodon
|
||||||
.. py:class: Mastodon
|
.. py:class: Mastodon
|
||||||
|
|
||||||
|
Usage
|
||||||
|
-----
|
||||||
Register your app! This only needs to be done once. Uncomment the code and substitute in your information:
|
Register your app! This only needs to be done once. Uncomment the code and substitute in your information:
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
@ -24,7 +26,11 @@ 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(client_id = '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.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:
|
||||||
|
|
||||||
@ -35,13 +41,15 @@ To post, create an actual API instance:
|
|||||||
mastodon = Mastodon(access_token = 'pytooter_usercred.secret')
|
mastodon = Mastodon(access_token = 'pytooter_usercred.secret')
|
||||||
mastodon.toot('Tooting from Python using #mastodonpy !')
|
mastodon.toot('Tooting from Python using #mastodonpy !')
|
||||||
|
|
||||||
|
Introduction
|
||||||
|
------------
|
||||||
`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.
|
as a single Python module.
|
||||||
|
|
||||||
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.3. The
|
||||||
Mastodon compatible API layers of various other pieces of software as well
|
Mastodon compatible API layers of various other pieces of software as well
|
||||||
as forks, while not an official target, should also be basically
|
as forks, while not an official target, should also be basically
|
||||||
compatible, and Mastodon.py does make some allowances for behaviour that isn't
|
compatible, and Mastodon.py does make some allowances for behaviour that isn't
|
||||||
@ -85,4 +93,3 @@ about who helped with which particular feature or fix in the changelog.
|
|||||||
|
|
||||||
14_contributing
|
14_contributing
|
||||||
15_everything
|
15_everything
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user