Created
February 15, 2018 14:05
-
-
Save marron-akanishi/fb5a517a05620e864c8b967b999e9b9a to your computer and use it in GitHub Desktop.
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
# 環境構築確認 | |
import json | |
import tweepy as tp | |
def get_oauth(): | |
"""設定ファイルから各種キーを取得し、OAUTH認証を行う""" | |
setting = json.load(open("./setting.json")) | |
auth = tp.OAuthHandler(setting['CK'], setting['CS']) | |
auth.set_access_token(setting['Admin_Key'], setting['Admin_Secret']) | |
return auth | |
def main(): | |
print("tweepy test") | |
auth = get_oauth() | |
api = tp.API(auth) | |
api.update_status("テストツイート") | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment