Twitter tweets per second
One can judge how many tweets are posted based on twitter logs kept locally. Locally, as on your server. Logs ready to be analyzed.
With every new tweet a tweet id (TID) is entered into their database. The tweet IDS are sequential. If one posts one tweet and another posts a tweet right after, the two tweets will have sequential IDS.
Recently, I advertised my blog, promoting some Zephyrness, and the twitter posts spanned an interval of one minute and twenty four seconds.
I analyzed my tweet IDS in order to ascertain the number of tweets posted, per second.
Based on this logic:
The number for my first Tweet id (TID) was 3260889338.
My next tweet, which was one minute and 24 seconds after my last, had the TID of 3260905890.
These were my own tweets; remember, they were one minute and twenty four seconds apart.
Assuming that each tweet creates an incremental TID (tweet++?), subtract these two numbers to determine how many tweets were posted in one minute and twenty four seconds.
3260889338 – 3260905890 = 16552.
My posts were composed late at night. Nevertheless, during the span of 1 minute and 24 seconds, 16552 tweets were posted.
Translated: this was 197 tweets per second.
god damn.
I analyzed my previous 20 tweets, posted between Nov 27 and Dec 15. By my calculations, Twitter ran at about 341 T/s (Tweets per second) during that period. Here’s the raw data. “Posted at” is in seconds since Jan 1st, 1970 00:00 UTC.
Tweet ID Posted at
6688881924 1260859423
6688647361 1260858669
6688391033 1260857888
6687519235 1260855422
6684180230 1260847670
6593999968 1260603568
6589524394 1260590134
6519056831 1260414413
6453947072 1260246057
6326359628 1259899023
6297504014 1259826605
6139415887 1259408523
6138755479 1259405385
6138700380 1259405110
6137399546 1259398733
6120476745 1259350524
6120462204 1259350487
6120215447 1259349855
Tweets per second: 341.235294118
Here’s the Python code I used to calculate the value (you’ll need the Twitter python module):
import twitter
api = twitter.Api()
tweets = api.GetUserTimeline(‘TerrorBite’) # Fetch my tweets
tweets.reverse() # Earlier tweets first
prevsecs = 0
previd = 0
count = 0
tps = 0.0
for t in tweets:
if prevsecs != 0:
# Get the difference since the last post:
timegap = t.created_at_in_seconds – prevsecs
tweetgap = t.id – previd
# Calculate tweets per second for this interval
tps += tweetgap / timegap
count +=1
prevsecs = t.created_at_in_seconds
previd = t.id
print ‘Tweets per second:’, (tps / count) # Taking an average
Using an updated script:
Fetching tweets for seanfindley
Analyzing @seanfindley’s tweets between Mon Aug 10 18:31:28 +0000 2009 and Fri Aug 14 18:18:12 +0000 2009…
Global tweets/sec: 225.368
Fetching tweets for Sockington
Analyzing @Sockington’s tweets between Sat Dec 05 19:21:08 +0000 2009 and Mon Dec 14 17:11:04 +0000 2009…
Global tweets/sec: 388.632
Updated code: http://pastebin.org/65048