Update README.md

This commit is contained in:
spla 2022-07-24 21:54:08 +02:00
pare 4fced75d90
commit 4d19b21940

Veure arxiu

@ -6,25 +6,28 @@ Python wrapper for the Akkoma (https://akkoma.dev/AkkomaGang/akkoma) API.
from akkoma import Akkoma
'''
Akkoma.create_app(
'pytooterapp',
api_base_url = 'https://yourakkomainstance.social',
to_file = 'pytooter_clientcred.secret'
)
client_id, client_secret = Akkoma.create_app(
'app_name',
to_file="app_clientcred.txt",
api_base_url = 'https://yourakkoma.instance'
)
'''
# Then login. This can be done every time, or use persisted.
from akkoma import Akkoma
akkoma = Akkoma(
client_id = 'pytooter_clientcred.secret',
api_base_url = 'https://yourakkomainstance.social'
)
akkoma = Akkoma(client_id = "app_clientcred.txt", api_base_url = 'https://yourakkoma.instance')
grant_type = 'password'
akkoma.log_in(
'my_login_email@example.com',
'incrediblygoodpassword',
to_file = 'pytooter_usercred.secret'
client_id,
client_secret,
grant_type,
'user',
'password',
to_file = "app_usercred.txt"
)
# To post, create an actual API instance.
@ -32,9 +35,9 @@ Python wrapper for the Akkoma (https://akkoma.dev/AkkomaGang/akkoma) API.
from akkoma import Akkoma
akkoma = Akkoma(
access_token = 'pytooter_usercred.secret',
api_base_url = 'https://yourakkomainstance.social'
access_token = 'app_usercred.txt',
api_base_url = 'https://yourakkoma.instance'
)
akkoma.status_post('Tooting from python using #akkomapy !')
akkoma.status_post('Posting from python using Akkoma.py !')