Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
【Python】tweepyを使ってツイートを検索する方法
# 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