aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'README.rst')
-rw-r--r--README.rst80
1 files changed, 38 insertions, 42 deletions
diff --git a/README.rst b/README.rst
index 39923b9..a49a5e2 100644
--- a/README.rst
+++ b/README.rst
@@ -1,49 +1,45 @@
1Mastodon.py 1Mastodon.py
2=========== 2===========
3Register your app! This only needs to be done once. Uncomment the code and substitute in your information. 3Python wrapper for the Mastodon ( https://github.com/tootsuite/mastodon/ ) API.
4 4Feature complete for public API as of Mastodon version 2.8.0 and easy to get started with:
5.. code-block:: python
6
7 from mastodon import Mastodon
8
9 '''
10 Mastodon.create_app(
11 'pytooterapp',
12 api_base_url = 'https://mastodon.social',
13 to_file = 'pytooter_clientcred.secret'
14 )
15 '''
16
17Then login. This can be done every time, or use persisted.
18
19.. code-block:: python
20
21 from mastodon import Mastodon
22
23 mastodon = Mastodon(
24 client_id = 'pytooter_clientcred.secret',
25 api_base_url = 'https://mastodon.social'
26 )
27 mastodon.log_in(
28 '[email protected]',
29 'incrediblygoodpassword',
30 to_file = 'pytooter_usercred.secret'
31 )
32
33To post, create an actual API instance.
34 5
35.. code-block:: python 6.. code-block:: python
36 7
37 from mastodon import Mastodon 8 #Register your app! This only needs to be done once. Uncomment the code and substitute in your information.
38 9
39 mastodon = Mastodon( 10 from mastodon import Mastodon
40 access_token = 'pytooter_usercred.secret', 11
41 api_base_url = 'https://mastodon.social' 12 '''
42 ) 13 Mastodon.create_app(
43 mastodon.toot('Tooting from python using #mastodonpy !') 14 'pytooterapp',
44 15 api_base_url = 'https://mastodon.social',
45Python wrapper for the Mastodon ( https://github.com/tootsuite/mastodon/ ) API. 16 to_file = 'pytooter_clientcred.secret'
46Feature complete for public API as of Mastodon version 2.4.3 and easy to get started with. 17 )
18 '''
19
20 # Then login. This can be done every time, or use persisted.
21
22 from mastodon import Mastodon
23
24 mastodon = Mastodon(
25 client_id = 'pytooter_clientcred.secret',
26 api_base_url = 'https://mastodon.social'
27 )
28 mastodon.log_in(
29 '[email protected]',
30 'incrediblygoodpassword',
31 to_file = 'pytooter_usercred.secret'
32 )
33
34 # To post, create an actual API instance.
35
36 from mastodon import Mastodon
37
38 mastodon = Mastodon(
39 access_token = 'pytooter_usercred.secret',
40 api_base_url = 'https://mastodon.social'
41 )
42 mastodon.toot('Tooting from python using #mastodonpy !')
47 43
48You can install Mastodon.py via pypi: 44You can install Mastodon.py via pypi:
49 45
@@ -56,7 +52,7 @@ You can install Mastodon.py via pypi:
56 pip3 install Mastodon.py 52 pip3 install Mastodon.py
57 53
58Full documentation and basic usage examples can be found 54Full documentation and basic usage examples can be found
59at http://mastodonpy.readthedocs.io/en/latest/ . 55at http://mastodonpy.readthedocs.io/en/stable/ .
60 56
61Acknowledgements 57Acknowledgements
62---------------- 58----------------
Powered by cgit v1.2.3 (git 2.41.0)