Skip to content


Collecting Twitter Data After An Event – GeoTweetHistory.pl

Follow @znbeta To Sign up for Social Media Analytics Research Toolkit Private Beta!

I am releasing the Perl script I run to collect Twitter data after an event, GeoTweetHistory.pl, as an open source project, under the Artistic License. This is the same license that Perl uses. I’ve been using this script or variations of it since before the Haiti earthquake, so it’s pretty well tested.

The master repository is on Github at http://github.com/znmeb/GeoTweetHistory. As far as I know, GeoTweetHistory.pl will run on any modern version of Perl, but I’ve only tested it on Perl 5.10 on openSUSE Linux 11.2, and with ActiveState ActivePerl on Windows. If you have any trouble running it, please feel free to send me a tweet @znmeb.

How does it work? When an event happens, people tweet about it. These tweets go into Twitter Search, and unless Twitter has blocked the person tweeting, the tweets get indexed. Events almost always have a location associated with them. In the case of an earthquake, the USGS gives the coordinates and time of the earthquake on their web site as soon as they have this information. The web site is http://earthquake.usgs.gov/earthquakes/recenteqsww/.

So all you have to do is go to the USGS site, find the earthquake details, and get the location of the earthquake. Once you have the location details, you simply run GeoTweetHistory.pl. The script accesses Twitter Search back in time and delivers all tweets within the specified circle. You get the results in a comma-separated-value (CSV) file, which you can then open in a spreadsheet. There are more details on running the script at http://github.com/znmeb/GeoTweetHistory/blob/master/README.

Again, please feel free to send me a tweet if you need help getting this running. And special thanks to Marc Mims (@semifor), who has developed the Net::Twitter Perl module that interfaces with the Twitter API!

  • Twitter
  • Technorati Favorites
  • DZone
  • Share/Bookmark

Posted in Uncategorized.

Tagged with , , , , , , , , , , , , , , , , , , , , .


19 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. znmeb says

    RT @DZone “Collecting Twitter Data After An Event – GeoTweetHistory.pl” http://borasky-research.net/2010/03/03/c...

  2. znmeb says

    RT @DZone “Collecting Twitter Data After An Event – GeoTweetHistory.pl” http://borasky-research.net/2010/03/03/c...

  3. znmeb says

    Collecting Twitter Data After An Event – GeoTweetHistory.pl | Borasky Research Journal http://borasky-research.net/2010/03/03/c...

Continuing the Discussion

  1. USGS Working On Earthquake Detection Via Twitter! | Borasky Research Journal linked to this post on 2010/03/03

    [...] Collecting Twitter Data After An Event – GeoTweetHistory.pl [...]

  2. Lisa Tweedie linked to this post on 2010/03/04

    znmeb

    RT Collecting Twitter Data After An Event – GeoTweetHistory.pl | Borasky Research Journal http://meb.tw/bh9qqh #vivatwitter

  3. Lisa Tweedie linked to this post on 2010/03/04

    RT @znmeb: Collecting Twitter Data After An Event – GeoTweetHistory.pl | Borasky Research Journal http://meb.tw/bh9qqh

  4. Ed Borasky linked to this post on 2010/03/04

    RT @TopsyRT: Collecting Twitter Data After An Event – GeoTweetHistory.pl http://bit.ly/biv6IX

  5. Ed Borasky linked to this post on 2010/03/04

    RT @DZone "Collecting Twitter Data After An Event – GeoTweetHistory.pl" http://dzone.com/shax

  6. Project EPIC linked to this post on 2010/03/04

    RT @znmeb: RT @DZone "Collecting Twitter Data After An Event – GeoTweetHistory.pl" http://dzone.com/shax

  7. Kate Starbird linked to this post on 2010/03/04

    RT @znmeb: RT @DZone "Collecting Twitter Data After An Event – GeoTweetHistory.pl" http://dzone.com/shax

  8. Richard Laksana linked to this post on 2010/03/05

    Collecting Twitter Data After An Event – GeoTweetHistory.pl – http://su.pr/2zZPM3

  9. John OBrien III linked to this post on 2010/03/05

    RT @znmeb: RT @DZone "Collecting Twitter Data After An Event – GeoTweetHistory.pl" http://dzone.com/shax

  10. Dr. Andreas SchΓ€fer linked to this post on 2010/03/05

    Code- Collecting Twitter Data After An Event – GeoTweetHistory.pl http://bit.ly/biv6IX /via @znmeb

  11. Jenn Hamilton linked to this post on 2010/03/07

    RT @TopsyRT: Collecting Twitter Data After An Event – GeoTweetHistory.pl http://bit.ly/biv6IX

  12. Social Media Analytics Research Toolkit (SMART@znmeb) Is Moving Into Private Beta « Borasky Research Journal linked to this post on 2010/03/31

    [...] Geographic historical search to CSV file [...]



Borasky Research Journal is Digg proof thanks to caching by WP Super Cache