Last active
April 7, 2018 19:19
-
-
Save miya/a7a3abaf3ab2a7c3725babcd6b338a18 to your computer and use it in GitHub Desktop.
MastodonのSetupするやつ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from mastodon import Mastodon | |
url = "https://mstdn.jp" #URLの部分はインスタンスURLです。今回はmstdn.jpになっていますが、任意で変更して下さい。 | |
name = input('クライアント名\n> ') #クライアント名を入力して下さい。(自由記述) | |
#Mastodonのアプリ登録を行ないます。 | |
Mastodon.create_app(name, | |
api_base_url = url, | |
to_file = "app_key.txt" | |
) | |
print('api_key作成完了!') | |
mail = input('メールアドレス\n> ') #アカウント作成に使用したメールアドレスを入力して下さい | |
passwd = input('パスワード\n> ') #アカウント作成に使用したパスワードを入力して下さい。 | |
#生成されたapp.keyをしてしてログインします。 | |
mastodon = Mastodon( | |
client_id="app_key.txt", | |
api_base_url = url) | |
mastodon.log_in( | |
mail, | |
passwd, | |
to_file = "user_key.txt") | |
print('user_key作成完了!') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment