Update README.md

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

Veure arxiu

@ -6,10 +6,10 @@ Python wrapper for the Akkoma (https://akkoma.dev/AkkomaGang/akkoma) API.
from akkoma import Akkoma from akkoma import Akkoma
''' '''
Akkoma.create_app( client_id, client_secret = Akkoma.create_app(
'pytooterapp', 'app_name',
api_base_url = 'https://yourakkomainstance.social', to_file="app_clientcred.txt",
to_file = 'pytooter_clientcred.secret' api_base_url = 'https://yourakkoma.instance'
) )
''' '''
@ -17,14 +17,17 @@ Python wrapper for the Akkoma (https://akkoma.dev/AkkomaGang/akkoma) API.
from akkoma import Akkoma from akkoma import Akkoma
akkoma = Akkoma( akkoma = Akkoma(client_id = "app_clientcred.txt", api_base_url = 'https://yourakkoma.instance')
client_id = 'pytooter_clientcred.secret',
api_base_url = 'https://yourakkomainstance.social' grant_type = 'password'
)
akkoma.log_in( akkoma.log_in(
'my_login_email@example.com', client_id,
'incrediblygoodpassword', client_secret,
to_file = 'pytooter_usercred.secret' grant_type,
'user',
'password',
to_file = "app_usercred.txt"
) )
# To post, create an actual API instance. # 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 from akkoma import Akkoma
akkoma = Akkoma( akkoma = Akkoma(
access_token = 'pytooter_usercred.secret', access_token = 'app_usercred.txt',
api_base_url = 'https://yourakkomainstance.social' api_base_url = 'https://yourakkoma.instance'
) )
akkoma.status_post('Tooting from python using #akkomapy !') akkoma.status_post('Posting from python using Akkoma.py !')