Created
September 22, 2016 19:20
-
-
Save geordee/64fffcee506386834103724681271b7f 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
#!/usr/bin/env python | |
import tweepy | |
from collections import Counter | |
consumer_key = 'consumer_key' | |
consumer_secret = 'consumer_secret' | |
access_token = 'access_token' | |
access_token_secret = 'access_token_secret' | |
auth = tweepy.OAuthHandler(consumer_key, consumer_secret) | |
auth.set_access_token(access_token, access_token_secret) | |
api = tweepy.API(auth) | |
def process(tweet): | |
return tweet.author.screen_name | |
results = [] | |
for tweet in tweepy.Cursor(api.search, q='HASHTAG').items(): | |
results.append(process(tweet)) | |
counts = Counter(results) | |
print(counts) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment