aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'README.rst')
-rw-r--r--README.rst19
1 files changed, 14 insertions, 5 deletions
diff --git a/README.rst b/README.rst
index 97919e0..39923b9 100644
--- a/README.rst
+++ b/README.rst
@@ -1,10 +1,11 @@
1Mastodon.py 1Mastodon.py
2=========== 2===========
3Register your app! This only needs to be done once. Uncomment the code and substitute in your information.
4
3.. code-block:: python 5.. code-block:: python
4 6
5 from mastodon import Mastodon 7 from mastodon import Mastodon
6 8
7 # Register app - only once!
8 ''' 9 '''
9 Mastodon.create_app( 10 Mastodon.create_app(
10 'pytooterapp', 11 'pytooterapp',
@@ -13,8 +14,12 @@ Mastodon.py
13 ) 14 )
14 ''' 15 '''
15 16
16 # Log in - either every time, or use persisted 17Then login. This can be done every time, or use persisted.
17 ''' 18
19.. code-block:: python
20
21 from mastodon import Mastodon
22
18 mastodon = Mastodon( 23 mastodon = Mastodon(
19 client_id = 'pytooter_clientcred.secret', 24 client_id = 'pytooter_clientcred.secret',
20 api_base_url = 'https://mastodon.social' 25 api_base_url = 'https://mastodon.social'
@@ -24,9 +29,13 @@ Mastodon.py
24 'incrediblygoodpassword', 29 'incrediblygoodpassword',
25 to_file = 'pytooter_usercred.secret' 30 to_file = 'pytooter_usercred.secret'
26 ) 31 )
27 '''
28 32
29 # Create actual API instance 33To post, create an actual API instance.
34
35.. code-block:: python
36
37 from mastodon import Mastodon
38
30 mastodon = Mastodon( 39 mastodon = Mastodon(
31 access_token = 'pytooter_usercred.secret', 40 access_token = 'pytooter_usercred.secret',
32 api_base_url = 'https://mastodon.social' 41 api_base_url = 'https://mastodon.social'
Powered by cgit v1.2.3 (git 2.41.0)