Created
May 29, 2016 09:26
-
-
Save kurozumi/fee149ff02a968b5990e98f63c049320 to your computer and use it in GitHub Desktop.
【Python】tweepyを使ってツイートを検索する方法
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
# coding: utf-8 | |
import tweepy | |
CONSUMER_KEY = "コンシューマーキー設定" | |
CONSUMER_SECRET = "コンシューマーシークレットキー設定" | |
auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET) | |
ACCESS_TOKEN = "アクセストークン設定" | |
ACCESS_SECRET = "アクセスシークレットトークン設定" | |
auth.set_access_token(ACCESS_TOKEN, ACCESS_SECRET) | |
api = tweepy.API(auth) | |
for tweet in api.search(q=u"iphone"): | |
print tweet.text |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment