Skip to content

Instantly share code, notes, and snippets.

@marron-akanishi
Created February 15, 2018 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marron-akanishi/fb5a517a05620e864c8b967b999e9b9a to your computer and use it in GitHub Desktop.
Save marron-akanishi/fb5a517a05620e864c8b967b999e9b9a to your computer and use it in GitHub Desktop.
# 環境構築確認
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