Various Mastodon Bots

register.py 682B

12345678910111213141516171819202122232425262728293031323334
  1. #!/usr/bin/python3
  2. from mastodon import Mastodon
  3. #Register Stallminator app, should only need to be executed once
  4. def main():
  5. print("Enter App Name: ")
  6. appName = input()
  7. print("Enter name of credential file: ")
  8. credentialFile = input()
  9. print("Enter name of instance URL: ")
  10. url = input()
  11. register_app(appName, credentialFile, url)
  12. print(appName, " has been succesfully registered");
  13. def register_app(appName, credentialFile, url):
  14. SECRET_DIR = '/home/z/prj/mastobots/secrets/'
  15. Mastodon.create_app(
  16. appName,
  17. api_base_url = url,
  18. to_file = SECRET_DIR + credentialFile)
  19. if __name__ == '__main__':
  20. main()