27 lines
712 B
Python
27 lines
712 B
Python
from mastodon import Mastodon
|
|
|
|
def setup_mastodon():
|
|
print("Setup")
|
|
print("---------------")
|
|
api_base_url = input("Enter Mastodon instance URL (e.g., https://mastodon.social): ")
|
|
email = input("Enter your email: ")
|
|
password = input("Enter your password: ")
|
|
|
|
Mastodon.create_app(
|
|
'pytooterapp',
|
|
api_base_url=api_base_url,
|
|
to_file='pytooter_clientcred.secret'
|
|
)
|
|
|
|
mastodon = Mastodon(client_id='pytooter_clientcred.secret', api_base_url=api_base_url)
|
|
mastodon.log_in(
|
|
email,
|
|
password,
|
|
to_file='pytooter_usercred.secret'
|
|
)
|
|
|
|
print("Setup complete.")
|
|
|
|
if __name__ == "__main__":
|
|
setup_mastodon()
|