From 969e5dff1416b9f4a63f6bdb0cd58089860d49d8 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Sat, 1 Apr 2017 15:08:13 +0200 Subject: [mod] sync README.rst and doc index to avoid confusion --- README.rst | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 2d51698..0ddd641 100644 --- a/README.rst +++ b/README.rst @@ -2,8 +2,29 @@ Mastodon.py =========== .. code-block:: python + from mastodon import Mastodon + + # Register app - only once! + ''' + Mastodon.create_app( + 'pytooterapp', + to_file = 'pytooter_clientcred.txt' + ) + ''' + + # Log in - either every time, or use persisted + ''' + mastodon = Mastodon(client_id = 'pytooter_clientcred.txt') + mastodon.log_in( + 'my_login_email@example.com', + 'incrediblygoodpassword', + to_file = 'pytooter_usercred.txt' + ) + ''' + + # Create actual instance mastodon = Mastodon( - client_id = 'pytooter_clientcred.txt', + client_id = 'pytooter_clientcred.txt', access_token = 'pytooter_usercred.txt' ) mastodon.toot('Tooting from python!') -- cgit v1.2.3