Skip to content

Instantly share code, notes, and snippets.

@geordee
Created September 22, 2016 19:20
Show Gist options
  • Save geordee/64fffcee506386834103724681271b7f to your computer and use it in GitHub Desktop.
Save geordee/64fffcee506386834103724681271b7f to your computer and use it in GitHub Desktop.
#!/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