Woe to me, since I'm still learning Python ..
I want to see the most trash tweets for a specific hashtag. I can find trending tweets, and I can find tweets with a specific hashtag, but I find it difficult to try to combine these two.
import tweepy
CONSUMER_KEY = 'key'
CONSUMER_SECRET = 'secret'
OAUTH_TOKEN = 'key'
OAUTH_TOKEN_SECRET = 'secret'
auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
auth.set_access_token(OAUTH_TOKEN, OAUTH_TOKEN_SECRET)
api = tweepy.API(auth)
trends = api.trends_place(1)
search_hashtag = tweepy.Cursor(api.search, q='hashtag').items(5000)
for tweet in search_hashtag:
print json.dumps(tweet)
print json.dumps(trends, indent=1)
This is what I am working on right now.
Thank!
source
share