Twitter Stats
Final Update to This Post For those not following along at home, I finally took Twitter Stats to the next level and released a webified version over at TweetStats.com. I, somewhat unfortunately, had to go with TweetStats as twitterstats.com was already taken.
I made a post about it here and you can see an example of my stats on the site on the graphs page.
So I’ve been a user on Twitter for a little over a year, but it wasn’t until recently when I hit 2000 tweets that I wanted to see what my Twitter history looked like over that period. Ever being the statistics nerd, I pulled down all of my tweets and using a combination of curl, sed, grep, Excel, and Numbers, managed to generate some nice graphs.
Being the automation weenie that I am, I eventually hacked together a perl script that did everything except paste the data into Numbers.Although I won’t post it here (because I think the Twitterocracy would have a cow with how it’s implemented), you can DM me your email and I’ll send you the code and instructions. See below - bugs be damned, I’ve made it publicly available.
Basically, the script pulls down all your tweets and stores them in an csv file. It then runs some statistics on the csv file and then copies the resulting stats to the OS X clipboard to paste into each table within Numbers. If run with a pre-existing tweets csv file, the script will calculate the different between your current status count and only download the pages necessary, thus saving the Twitter servers from some bandwidth.
For the record, here are mine. ![]()
Update Thanks to kosmar for pointing out that I can actually do this entire thing without your password. Head => Wall. I’ll be updating it accordingly and hopefully even making a webservice out of it soon.
In addition to not needing your password, the script should also adjust the times for your tweets to whatever the system time is where you run the script.
Another update: I’ve also posted the script on my site and you can download it here: twitter_stats.zip. Feel free to contact me with any questions via twitter or web.dpc at dcortesi . com.
Many people have noticed a large after-lunch spike around 2pm. At least for me, this was due to Twitter being down most of the morning one day and then tweeting like crazy when it came back online.
BUG FOUND AND SQUASHED
There was a small bug that cropped up after I switched the script to not require your password. It accounts for the odd “[Tuesday|January|2pm] Peak” that people were seeing. This bug has now been fixed and an updated script is available. My apologies.
Unfortunately, if want the most accurate tweets, you will have to rm your csv file and run the script again.
Date::Calc aka failure on line 13
Some of you (on Tiger?) may be missing the Date::Calc module that I use to figure out weekdays. Although I tried to use as few perl modules as possible, this one was essential. Use the following command (thanks to a couple twitter peeps for the reference) to install:
sudo perl -MCPAN -e 'install Date::Calc' and keep hitting ‘y’.
Final (hopefully) Update on this page as it’s getting messy.
For those of you not on OS X with Numbers, there are a few options:
@bck webified my code (w00t): Twitter Stats
@mmc decided to use gnuplot: Twitter Stats in SVG Using GNUPlot
@cbarrett modified it to utilize the Google Chart API: Twitter Stats with GChart
@kejadlen reverse engineered my original script to Ruby: Twitter Stats in Ruby
I still want to write my own webified version (Google Chart aesthetics leave a little bit to be desired…), but I have yet to settle on an option that I like.
89 Comments so far
Leave a comment
That is just too awesome.
By Sameer Vastaon 12.27.07 10:08 pm
Hi Damon,
That’s just awesome! Since I just reached the 7,000 updates score today, I’m eager to have a look at my own stats. Would you be so kind to share your scripts with me?
TIA,
Christophe LaueR
–
http://twitter.com/clauer/
By CLaueRon 12.28.07 8:42 am
O_o i’d love to see this. you got my mail …
By kosmaron 12.28.07 8:43 am
congrat for this…can i have mine?…txs
By Davidon 12.29.07 7:25 am
Twitter statistics…
After I learned via @twtooltrack that Damon Cortesi had hacked a perl script to find out some basic stats of your own twitter behaviour, I just asked him for the file and ran it on my account. Here is what came out:
One more click for the large vie…
By || kosmar ||on 12.29.07 7:37 am
This is going to be awesome. Can I have the instructions? I am super excited to see some stats on my tweets
Thanks.
By Godyon 01.01.08 7:01 pm
[…] day to post some graphs of my Twitter usage. A huge amount of thanks goes to Damon Cortesi for his work on the Perl script that creates these stats and the Numbers template for creating the pretty […]
By Twitter Stats at jamiephelps.comon 01.01.08 7:53 pm
Slick. Thanks for sharing.
By Pedroon 01.01.08 8:00 pm
Too bad-ass! Can’t wait to unzip it! :^)
By Road Hackeron 01.01.08 8:31 pm
I really like using it, fun to see all the results and such. I’ll write an entry about it soon. I’ll help to promote it.
By warzabidulon 01.01.08 8:32 pm
Very cool and easy to use. Thanks.
By Alan Hoganon 01.01.08 8:54 pm
[…] stats! Thanks to Damon Cortesi (https://twitter.com/dacort) for his awesome Twitter Stats script (http://dcortesi.com/2007/12/27/twitter-stats/). And to think. I said I wouldn’t use Twitter. I said I wouldn’t become addicted. I […]
By Twiter Statson 01.01.08 9:05 pm
[…] was kind enough to gather my Twitter stats for me. Check out his blog for the script he created to do […]
By Nordquist Blog » Blog Archive » My Twitter Statson 01.01.08 9:12 pm
So, I noticed you wrote that you no longer have to use your password for this script. Convenient, yes, although I just wanted to mention that for those with protected tweets it doesn’t work. Easy for me to solve. I just unprotected mine as it downloaded them, then protected again. But I think it would be handy to keep a version of this that asks for a password to get around that.

Awesome work!
By Rob Broganon 01.01.08 9:13 pm
Rob - good catch, I hadn’t considered that.
I’ll make one available at some point that can use your password.
By Damonon 01.01.08 9:21 pm
[…] djmartian wrote an interesting post today onHere’s a quick excerpt […]
By Twitter Statson 01.01.08 9:35 pm
[…] stats Use this cute perl script + Numbers template to take a slightly different look at twitter activity. Here’s mine; I am @bkerr on […]
By Brian Kerr | Twitter statson 01.01.08 9:49 pm
Does the bug you just fixed explain why DaringFireball.net and RandsInRepose.com both report post-lunch spikes?
By Nickon 01.01.08 10:44 pm
[…] Damon Cortesi has published a nifty Perl script that generates stats based on your Twitter usage. […]
By Twitter Stats : idly [dot] orgon 01.01.08 11:33 pm
@nickon It would appear that way, unfortunately. :-\
I’m also aware some ppl don’t have Date::Calc installed and am looking for specific steps to get that installed. (Somebody else mentioned there were several steps, but I already have it installed as well as several different versions of perl :-\)
By Damonon 01.01.08 11:34 pm
This is great! Found a typo:
“Press enter to download remaining tweets and calcuate stats!”
“calcuate” should be “calculate”
Also, for protected tweets, this would be a great use of OAuth!
http://twitter.com/oauth
http://oauth.googlecode.com/svn/code/perl/
By Chris Messinaon 01.01.08 11:44 pm
Dude! THis is a damn sweet little perl script. We should tie it into a graphic lib so that you can have this automatically appear on your website
By whurleyon 01.02.08 12:07 am
@whurley That’s the plan.
Somebody already suggested Flot and Google Chart API (of course). It’s just a matter of sitting down and whipping up that code.
By Damonon 01.02.08 12:12 am
Very cool, I’m building the new http://whurley.com in perl so this will fit right in
By whurleyon 01.02.08 12:22 am
[…] DCortesi . blog » Twitter Stats A perl script for OS X that pulls down your public tweets and allows you to graph them using Numbers… […]
By Twitter Stats: Perl Script for Twitter Analysis - timlauer.orgon 01.02.08 12:30 am
Regarding implementation with Google Chart API: I’ve done it for you, for reasons I can’t entirely explain. (I was going to use tonight to start blogging again. So much for that idea.)
Right now it only emits the GCAPI URLs to STDOUT rather than actually doing anything useful like creating a web page with them. I’m going to fix that, but I’m posting this now as it’s already well past midnight. There are also a few bugfixes in there - it may be worth diffing to find them.
By Yozon 01.02.08 12:44 am
Ahem, not that URL. This one.
(This is why I should just go to bed now instead of continuing to hack on this.)
By Yozon 01.02.08 12:45 am
@Yoz Sweet, nice job! I’ll have to try it once I’ve had a little sleep too. ;o)
By Damonon 01.02.08 1:09 am
[…] year of Twitter. Late last night I saw a tweet from Tim Lauer referring me to a Perl script from Damon Cortesi “that pulls down your public tweets and allows you to graph them using Numbers.” Pretty […]
By Open Thinking & Digital Pedagogy » Twitter Stats - 2007on 01.02.08 1:34 am
[…] on the lookout for analytics to describe behavior, I ran across a perl script by Damon Cortesi tonight that pulled in my Twitter feed and generated some pretty graphs. The results - my Twitter […]
By Twitter stats for @ericlitman, 2007on 01.02.08 1:40 am
You can get that CPAN install with even fewer keystrokes:
$ sudo cpan Date::Calc
By Simonon 01.02.08 2:20 am
[…] So here are my Twitter stats. Generated and made pretty by the awesome script created by Damon Cortesi. […]
By My Twitter Statson 01.02.08 2:26 am
Damon, just a few questions. I assume most of this info is global according to your list of tweeps? Because according to the stats, I’m tweeting while I sleep, and I can’t recall 300+ tweets I made on Monday. This could also be indicative of a serious addiction on my end.
Is there a way to just find out my personal stats?
Could you provide a summary for each table to help us understand what each represents? For instance, I’m not clear on the difference between top conversational @’s and top @replies.
Thanks for this script, BTW. It’s very cool to see Twitter, Numbers, and Terminal merge usefully.
By Douglas Cooteyon 01.02.08 3:34 am
I tried it few weeks ago too, to determine the time of the day my friends were twitting, here is the result:
http://blog.alexgirard.com/2007/11/12/ruby-twittline/
By Alexandre Girardon 01.02.08 3:39 am
[…] Twitter lovers out there, like me, I’ve put together a little script based on the work found here to calculate some statistics from your Twitter timeline and present them using the Google Charts […]
By Twitter Statistics Script - Pantslandon 01.02.08 4:37 am
Hi Damon, for some reason the script hangs forever on my tweets, and there are only 32. Same with http://bradkellett.com/twitter_stats.html which is based on it. Try to crunch my Twitter at http://twitter.com/pdwn
Bonne année, best wishes for 2008.
By padawanon 01.02.08 6:14 am
[…] ajutorul motorului de la Google Charts. Codul a fost adaptat de autorul Brad Kallet dupa cel de la DCortesi. Dupa ce desenele sunt generate, datele personale ale utilizatorului de la Twitter sunt […]
By Statistici personale ale utilizarii serviciului Twitter | MyKinda Tech si Gadgetson 01.02.08 6:54 am
[…] El servicio, simple como hay pocos, solo requiere que introduzcas el nombre de usuario de Twitter, tipo @tunick y te muestra gráficos. El sistema está elaborado a raíz del script para Mac de DCortesi. […]
By Gráfico de Twitter - Incubaweb 2.0 Bitácora del Software, Web 2.0, Beta, Windows, Linux, Mac OS X, Open Source, ....on 01.02.08 8:40 am
on the Date::Calc install i am getting an error in Terminal:
Recursive dependency detected:
Date::Calc
=> S/ST/STBEY/Date-Calc-5.4.tar.gz
=> Bit::Vector
=> S/ST/STBEY/Bit-Vector-6.4.tar.gz
=> Carp::Clan
=> J/JJ/JJORE/Carp-Clan-5.9.tar.gz
=> Object::Deadly
=> J/JJ/JJORE/Object-Deadly-0.09.tar.gz
=> Carp::Clan.
Cannot continue.
anyone else getting this?
By kyleon 01.02.08 8:56 am
[…] a bit like navel gazing to me. So by that logic Twitter would be Micro Navel Gazing (TM). Enter Twitter Stats, The Atomic Navel […]
By Twitter Hacks » Blog Archive » Twitter Stats - Navel Gazing at the Atomic Level!on 01.02.08 9:27 am
[…] todo gracias a Brad Kallet, quien adaptó el script que Damon Cortesi realizó para la plataforma Mac OS X, de manera que a través de su web podemos recibir una serie […]
By Twitter Stats, gráficas sobre el uso de Twitter de cualquier usuarioon 01.02.08 9:48 am
I thought I was never gonna be able to do this, not knowing any Perl and being a terminal newbie, but it was easy enough.
I wrote a quick guide how to it: http://www.wolfslittlestore.be/twitter/how-to-get-your-twitter-stats-for-2007
By Wolfon 01.02.08 9:50 am
Kyleon: Yes, I got that. I solved it by updating Bundle::CPAN first. The command would be as follows:
sudo perl -MCPAN -e ‘install Bundle::CPAN’
As usual, keep hitting y to install all the dependencies. Then go back and re-install Date::Calc.
By Simone Manganellion 01.02.08 9:55 am
Twitter stats using Ruby…
I saw Damon Cortesis Twitter Stats script last night, and decided to make a Ruby version….
By the alpha newswireon 01.02.08 10:19 am
[…] My Twitter Stats of 2007 thanks to Damon Cortesi. […]
By My Twitter Stats of 2007 | Funky Speaks v2.0on 01.02.08 11:09 am
Ooh, that looks so cool! If only I could run it, though; I have neither Perl nor OS X.
By Voyagerfan5761on 01.02.08 12:15 pm
[…] Cortesi has written a great little perl script that will generate your Twitter Stats which are then turned into some cool graphs of using the Numbers […]
By Twitter Stats, Charting Your Twitter Activity | Laughing Squidon 01.02.08 12:31 pm
[…] a Numbers template to paste them into. Since I don’t have Numbers, I’ve modified his script to write a file that can be read by gnuplot, and wrote a basic gnuplot script to output an SVG file […]
By michael-mccracken.net » Twitter Stats in SVG using gnuploton 01.02.08 1:05 pm
[…] es posible gracias a Brad Kallet, quien adaptó el script que Damon Cortesi realizó para la plataforma Mac OS X, y que a través de su web se puede generar una serie de […]
By Twitter Stats « En el Medioon 01.02.08 2:25 pm
[…] so pretty Twitter Stats With the recent surfacing of Damon Cortesi’s Twitter Stats I experienced my first real case of Mac envy. I tried running the Perl script on my Debian box, but […]
By Oh so pretty Twitter Stats :: h0bbel.p0ggel.orgon 01.02.08 2:54 pm
[…] Download the Twitter stats zip at http://dcortesi.com/2007/12/27/twitter-stats/ . […]
By How to get your 2007 Twitter stats - Wolf’s Little Storeon 01.02.08 3:13 pm
Hi Man.
Just a question. Why did you decide distribute your software for local running instead of hosting it in anyserver?
Is it due to the Twitter’s API usage restrictions?
Thanks in advance.
By xurdeon 01.02.08 3:34 pm
Hey Xurde - Perl was the easiest thing for me to hack the script up in and I really liked the way that the graphs generated by Numbers looked, so that’s the main reason I didn’t webify it. I didn’t initially expect to distribute it either, but I really enjoyed hacking away at it.
I’ve found a couple graphing packages that I like, but just have to sit down and pound the code out to support one of them.
Local development was a much quicker way for me to utilize currently existing tools to achieve a more pleasing result.
By Damonon 01.02.08 3:51 pm
[…] care to know your Twitter Stats? Posted in twitter, stats | Trackback | del.icio.us | Top Of […]
By Twitter Stats | Library Stuffon 01.02.08 9:24 pm
[…] Get stats on your Twitter usage (tags: analytics twitter) […]
By links for 2008-01-03 | Team Kane Street : Alex Rainert and Karen Bonna Rainerton 01.02.08 9:28 pm
[…] DCortesi . blog » Twitter Stats A Perl script that pulls data from your public Twitter stats and produces data to be pasted into a Numbers spreadsheet for data visualization… (tags: twitter visualization osx perl) […]
By links for 2008-01-03 - timlauer.orgon 01.03.08 12:24 am
[…] DCortesi . blog » Twitter Stats (tags: twitter statistics script osx) […]
By links for 2008-01-03 sur Everybody needs Somebaudyon 01.03.08 1:25 am
Doesn’t work with foreign charaters like the german umlauts (ä, ö, ü) if you wanna test it, run the script against my username: «daskaja». Seems like sed is the problem.
By Jenson 01.03.08 7:30 am
[…] to Damon for the hard […]
By Q.I. Productions - a wombat, the sink, and how it got there » Twitter statson 01.03.08 8:33 am
[…] habla hoy sobre Twitter Stats1, un programa escrito en Perl que los usuarios de Mac OS X que tengan Numbers instalado pueden […]
By Twitter Stats | enreason 01.03.08 10:34 am
[…] Twitter Stats. Basically, the script pulls down all your tweets and stores them in an csv file. It then runs some statistics on the csv file and then copies the resulting stats to the OS X clipboard to paste into each table within Numbers. © 1999-2008 Justin Blanton (e-mail) e v e r y t h i n g i s r e l a t i v e In partnership with […]
By Justin Blanton | Twitter Statson 01.03.08 5:54 pm
Amazing script, thank you
By xxdesmuson 01.03.08 8:28 pm
[…] Jens Meiert via Twitter bin ich heute mal auf Twitter Stats gestoßen, einem Skript von Damon […]
By Twitter-Statistik | eighty1on 01.04.08 5:37 am
[…] TwitterStats […]
By dy/dan » Blog Archive » You Just Put Your Lips Togetheron 01.04.08 9:09 am
[…] You can get the script over at http://dcortesi.com/2007/12/27/twitter-stats/ […]
By marusin.com » Blog Archive » I do loves me some Twitteron 01.04.08 2:51 pm
[…] fem måneder siden jeg skrev min første Twitter-status, og for noen dager siden kom jeg over Twitter Stats av Damon Cortesi som kartlegger Twitter-bruken […]
By ronny-andre.no » Twitter-statistikkon 01.04.08 4:27 pm
[…] thing I’m lazy… wait a day or two after seeing the original code and someone makes a nice little Twitter stats web service out of it (found via a CogDog […]
By Ruminate » Blog Archive » Twitter Statson 01.04.08 11:05 pm
[…] when I saw this Twitter stats script, I was intrigued to see what my numbers looked like. Call it internet naval-gazing, but I find it […]
By Code Sorcery Workshop » Twitter in reviewon 01.06.08 12:03 pm
[…] Cortesi wrote a cool perl script that sucks down a user’s tweets from 2007 and creates pretty charts via a Numbers.app […]
By 2007 Twitter Stats for @echeng | Eric Cheng’s Journalon 01.06.08 6:10 pm
我的twitter统计…
下面是来自这里的我的twitter使用情况的统计图表: Current statuses count: 4124 —- Tweets per Hour ——– Tweets per Day ——– Tweets per Month ——– Top @replies ——– Top overall @’s —- 这里有相关的介…
By 半亩塘闲话on 01.07.08 4:44 am
[…] January 7, 2008 · No Comments Thanks to a random discovery on Tara Hunt’s Flickr stream, I found out about Damon Cortesi’s script for generating charts out of Twitter. […]
By Twitterings in charts « The lost outposton 01.07.08 4:57 am
[…] up in the middle of the year thanks to programs like Twitterrific and Twitterberry. Now thanks to Damon Cortesi, who hacked up a quick and dirt script, you can see a visualization of my Twitter activity for 2007 […]
By Twitter Stats for 2007on 01.07.08 12:33 pm
[…] cool. He also mentions he’s wanting to get his up on the web too. Quick reference to his original perl script. Tags: Twitter, Twitter Hacks, Twitter Stats, Perl, Ruby SHARETHIS.addEntry({ title: “Twitter […]
By Twitter Hacks » Blog Archive » Twitter Stats: Web and Ruby Versions Tooon 01.07.08 5:51 pm
[…] not jealous, but insane? Totally. No really, I thought “hey, that’s cool.” The script he linked to was for OS X, which I don’t use so I waited. Today I found a site that did it online. The […]
By Ryanware » Twitter Statson 01.07.08 8:23 pm
[…] DCortesi . blog » Twitter Stats graph your twitter stats (tags: twitter statistics stats visualization script analytics web2.0 chart graph) […]
By Simon Scullion » links for 2008-01-09on 01.09.08 2:19 pm
[…] week ago, Damon Cortesi (who happens to be one rockin’ guy) wrote a little Perl script to help Twitter users create some really pretty graphs that chart their Twitter usage over the past year. In the week or so that has followed, everyone […]
By Eloquation » Blog Archive » I love Twitter, I love stats. I really love Twitter stats.on 01.10.08 3:10 am
[…] Cortesi over at DCortesi Blog recently commented about tracking his Twitter Stats. With over 2,000 Tweets (sum of Twitters), he wanted to understand what his history looked like […]
By Andy Wibbels » Twitter Stats: One More Thing To Trackon 01.16.08 5:26 am
I am new to twitter (18 posts), but when I tested the script it either took over 10 minutes and revved up my macbook fan because it was working like crazy… or it just hung. I have the newest version of leopard, can that be the culprit?
By ryanon 01.20.08 2:56 pm
[…] they should come out with social stats, like the ones Damon Cortesi and a few others made. But of course with stats being a native part of the platform it would be […]
By Stats: One Way Twitter Can be a Sharkon 01.29.08 9:21 am
[…] Stats01.30.08 | Comment? Last month a twitter stats script was released by Damon Cortesi. The small script connects to twitter and downloads all of your tweets for statistical analysis. […]
By No Time to Blog » Blog Archive » Twitter Statson 01.30.08 9:03 am
Thanks for the great script! I just posted stats to my blog. I’m running Leopard and was not only missing the Date::Calc module. I also was missing LWP which posed difficulty in downloading bundles. Luckily, I am a user of MacPorts and after installing lynx and wget (also surprisingly missing) I was able to reset the CPAN setup and proceed. Hopefully my experience will help someone else.
By Dan Harrelsonon 01.30.08 9:08 am
[…] in the month, we told you about TwitterStats, a downloadable script that would graph your Twitter statistics. The author of TwitterStats, Damon […]
By TweetStats displays your Twitter activity in graphical form | money news blogon 01.30.08 3:36 pm
[…] in the month, we told you about TwitterStats, a downloadable script that would graph your Twitter statistics. The author of TwitterStats, Damon […]
By Caminews » TweetStats displays your Twitter activity in graphical formon 01.30.08 5:20 pm
[…] que utiliza esta medio. Ya existen APIs para jugar con nuestras estadísticas de microbloggeo como TwitterStats, sitios que pretenden acercarnos a otros usuarios que comparten intereses más o menos parecidos, […]
By Palabras con contenido » Archivo del weblog »on 01.31.08 10:56 pm
[…] TweetStat […]
By 17 modi per visualizzare Twitter : Catepol 3.0on 03.13.08 1:11 pm
[…] fem måneder siden jeg skrev min første Twitter-status, og for noen dager siden kom jeg over Twitter Stats av Damon Cortesi som kartlegger Twitter-bruken […]
By Twitter-statistikk | Ronny-Andrés absolutismeon 03.15.08 1:13 pm
[…] TwitterStat Twitter统计数据 […]
By 十七种方法让你的Twitter世界可视化 | 中文赚钱博客on 03.21.08 5:10 pm
[…] some ways to get this information and stumbled across http://tweetstats.com, which is based on a perl script to generate some cool information but it takes too long and is not exactly what I wanted. At […]
By Brandan’s Thoughts » Blog Archive » Twitter Needs to Implement Statisticson 03.25.08 9:14 pm
[…] Cortesi wrote a pretty nifty script to grab some Twitter statistics. A bunch of people modified his script in order to webify it, plot the results using gnuplot, and […]
By Uptonian Thoughts » Twitter Stats - Thomas Upton And His Musingson 03.29.08 9:12 pm
Leave a comment
Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>