Skip to content

Instantly share code, notes, and snippets.

@edsu
Created April 3, 2019 10:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edsu/d6ae030a1557c197e684a01b7d6928f8 to your computer and use it in GitHub Desktop.
Save edsu/d6ae030a1557c197e684a01b7d6928f8 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
import sys
from twarc import Twarc
screen_name = sys.argv[1]
twitter = Twarc()
tweets = 0
retweets = 0
for tweet in twitter.timeline(screen_name=screen_name):
tweets += 1
if 'retweeted_status' in tweet:
retweets += 1
print('{0} has a retweet/tweet ratio of {1:.3f}'.format(screen_name, retweets/tweets))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment