Created
April 3, 2019 10:31
-
-
Save edsu/d6ae030a1557c197e684a01b7d6928f8 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 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