Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import twitter # easy_install python-twitter
- import getpass
- SCOBLE = 21.21 # tweets/day (velocity)
- WHETON = 500000 # followers (mass)
- COUNT = 200
- MAX_TWEETS = 1000
- username = raw_input("Username: ")
- password = getpass.getpass("Password: ")
- api = twitter.Api(username=username, password=password)
- messages = []
- since_id = None
- friends = api.GetFriends()
- # Get at most MAX_TWEETS
- print "Getting %s tweets" % (MAX_TWEETS, )
- for i in range(0, MAX_TWEETS / COUNT):
- messages += api.GetFriendsTimeline(count=200,
- since_id=since_id)
- if messages:
- since_id = messages[-1].id
- print "Got %s tweets" % (len(messages), )
- # If messages is empty break the loop, we can't go on.
- if not messages:
- break
- first = messages[0]
- last = messages[-1]
- # Get the time elapsed from the first tweet until the last
- elapsed = float(first.created_at_in_seconds - last.created_at_in_seconds)
- # Get the number of tweet over that time
- tweet_count = float(len(messages))
- # get the tweets per second
- tps = tweet_count / elapsed
- # convert that into tpd
- tpd = tps * 24 * 60 * 60
- # Calculate the scoble value
- scobles = tpd / SCOBLE
- # Calculate whetons
- whetons = float(len(friends)) / WHETON
- print "Your friends have:"
- print "Tweets/Day: %s" % (tpd, )
- print "Speed: %s scobles" % (scobles, )
- if whetons > 1:
- print "Mass: %s wheton" % whetons
- else:
- # Use milliwhetons for
- mw = whetons * 1000
- print "Mass: %s milliwhetons" % mw
- print "Momentium: %s Whetonscobles" % (whetons * scobles)
- print "Disclaimer: I know a Wheton is a unit of measurement of followers and not friends, but whatever."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement