A collection of Ruby command-line utilities for processing Twitter data in JSON format.
A command-line utility that reads tweets in JSON format from the standard input and outputs the hashtags in the tweets on the standard output.
cat tweets.json | ./extract-hashtags.rb > hashtags.txt
A command-line utility that reads tweets in JSON format from the standard input and outputs the user mentions in the tweets on the standard output.
cat tweets.json | ./extract-mentions.rb > mentions.txt
A command-line utility that reads tweets in JSON format from the standard input and outputs a GeoJSON feature collection on the standard output. Each geocoded tweet is represented by a point feature in the GeoJSON output.
cat tweets.json | ./tweets2geojson.rb > tweets.geojson
The tweets.geojson
output file can be imported into tools such as geojson.io and visualised by GitHub.