Small documentation adjustments

This commit is contained in:
Lorenz Diener 2017-06-15 20:48:59 +02:00
pare 5ed78fbe83
commit 03e19e3655
S'han modificat 2 arxius amb 9 adicions i 10 eliminacions

Veure arxiu

@ -10,8 +10,9 @@ Mastodon.py
# Register app - only once! # Register app - only once!
''' '''
Mastodon.create_app( Mastodon.create_app(
'pytooterapp', 'pytooterapp',
to_file = 'pytooter_clientcred.secret' api_base_url = 'https://mastodon.social',
to_file = 'pytooter_clientcred.secret'
) )
''' '''
@ -20,17 +21,19 @@ Mastodon.py
mastodon = Mastodon(client_id = 'pytooter_clientcred.secret') mastodon = Mastodon(client_id = 'pytooter_clientcred.secret')
mastodon.log_in( mastodon.log_in(
'my_login_email@example.com', 'my_login_email@example.com',
'incrediblygoodpassword', 'incrediblygoodpassword',
api_base_url = 'https://mastodon.social',
to_file = 'pytooter_usercred.secret' to_file = 'pytooter_usercred.secret'
) )
''' '''
# Create actual instance # Create actual API instance
mastodon = Mastodon( mastodon = Mastodon(
client_id = 'pytooter_clientcred.secret', client_id = 'pytooter_clientcred.secret',
access_token = 'pytooter_usercred.secret' access_token = 'pytooter_usercred.secret',
api_base_url = 'https://mastodon.social'
) )
mastodon.toot('Tooting from python!') mastodon.toot('Tooting from python using #mastodonpy !')
`Mastodon`_ is an ostatus based twitter-like federated social `Mastodon`_ is an ostatus 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

Veure arxiu

@ -22,10 +22,6 @@ class Mastodon:
If anything is unclear, check the official API docs at If anything is unclear, check the official API docs at
https://github.com/Gargron/mastodon/wiki/API https://github.com/Gargron/mastodon/wiki/API
Supported:
Username-Password Login
OAuth2
""" """
__DEFAULT_BASE_URL = 'https://mastodon.social' __DEFAULT_BASE_URL = 'https://mastodon.social'
__DEFAULT_TIMEOUT = 300 __DEFAULT_TIMEOUT = 300