diff options
author | MarkEEaton <[email protected]> | 2018-08-17 09:09:25 -0400 |
---|---|---|
committer | GitHub <[email protected]> | 2018-08-17 09:09:25 -0400 |
commit | dc4b3ffc03c3724c09862bb114736786a0679032 (patch) | |
tree | a5c058494afdea00590c2565849275281706cba8 /docs | |
parent | 84b1bc72496570f87f6d0ec52a8f8aa5f54addbe (diff) | |
download | mastodon.py-dc4b3ffc03c3724c09862bb114736786a0679032.tar.gz |
Update index.rst to reflect README.rst
Diffstat (limited to 'docs')
-rw-r--r-- | docs/index.rst | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/docs/index.rst b/docs/index.rst index 0cff37e..808e563 100644 --- a/docs/index.rst +++ b/docs/index.rst | |||
@@ -2,12 +2,13 @@ Mastodon.py | |||
2 | =========== | 2 | =========== |
3 | .. py:module:: mastodon | 3 | .. py:module:: mastodon |
4 | .. py:class: Mastodon | 4 | .. py:class: Mastodon |
5 | |||
6 | Register your app! This only needs to be done once. Uncomment the code and substitute in your information. | ||
5 | 7 | ||
6 | .. code-block:: python | 8 | .. code-block:: python |
7 | 9 | ||
8 | from mastodon import Mastodon | 10 | from mastodon import Mastodon |
9 | 11 | ||
10 | # Register app - only once! | ||
11 | ''' | 12 | ''' |
12 | Mastodon.create_app( | 13 | Mastodon.create_app( |
13 | 'pytooterapp', | 14 | 'pytooterapp', |
@@ -16,8 +17,12 @@ Mastodon.py | |||
16 | ) | 17 | ) |
17 | ''' | 18 | ''' |
18 | 19 | ||
19 | # Log in - either every time, or use persisted | 20 | Then login. This can be done every time, or use persisted. |
20 | ''' | 21 | |
22 | .. code-block:: python | ||
23 | |||
24 | from mastodon import Mastodon | ||
25 | |||
21 | mastodon = Mastodon( | 26 | mastodon = Mastodon( |
22 | client_id = 'pytooter_clientcred.secret', | 27 | client_id = 'pytooter_clientcred.secret', |
23 | api_base_url = 'https://mastodon.social' | 28 | api_base_url = 'https://mastodon.social' |
@@ -27,14 +32,18 @@ Mastodon.py | |||
27 | 'incrediblygoodpassword', | 32 | 'incrediblygoodpassword', |
28 | to_file = 'pytooter_usercred.secret' | 33 | to_file = 'pytooter_usercred.secret' |
29 | ) | 34 | ) |
30 | ''' | ||
31 | 35 | ||
32 | # Create actual API instance | 36 | To post, create an actual API instance. |
37 | |||
38 | .. code-block:: python | ||
39 | |||
40 | from mastodon import Mastodon | ||
41 | |||
33 | mastodon = Mastodon( | 42 | mastodon = Mastodon( |
34 | access_token = 'pytooter_usercred.secret', | 43 | access_token = 'pytooter_usercred.secret', |
35 | api_base_url = 'https://mastodon.social' | 44 | api_base_url = 'https://mastodon.social' |
36 | ) | 45 | ) |
37 | mastodon.toot('Tooting from python using #mastodonpy !') | 46 | mastodon.toot('Tooting from python using #mastodonpy !') |
38 | 47 | ||
39 | `Mastodon`_ is an ActivityPub and OStatus based twitter-like federated social | 48 | `Mastodon`_ is an ActivityPub and OStatus based twitter-like federated social |
40 | network node. It has an API that allows you to interact with its | 49 | network node. It has an API that allows you to interact with its |