Mastodonplus.py/docs/index.rst

26 líneas
880 B
ReStructuredText
Original Vista normal Històric

2016-11-24 02:27:00 +01:00
.. py:currentmodule:: mastodon
.. py:class:: Mastodon
2016-11-24 00:38:18 +01:00
2016-11-24 02:27:00 +01:00
Mastodon.py
===========
2016-11-24 00:58:14 +01:00
2016-11-24 02:27:00 +01:00
App creation and auth
---------------------
Before you can use the mastodon API, you have to register your application (which gets you a client key and client secret)
and then log in (which gets you an access token). These functions allow you to do those things.
For convenience, once you have a client id, secret and access token, you can simply pass them to the constructor of the class, too!
Note that while it is perfectly reasonable to log back in whenever your app starts, registering a new application on every
startup is not, so don't do that - instead, register an application once, and then persist your client id and secret. Convenience
methods for this are provided.
.. autofunction:: create_app
.. automethod:: __init__
.. automethod:: log_in
Reading timelines
-----------------