Skip to content

Instantly share code, notes, and snippets.

@mccv
Created August 3, 2010 19:13
Show Gist options
  • Save mccv/506952 to your computer and use it in GitHub Desktop.
Save mccv/506952 to your computer and use it in GitHub Desktop.
# need ruby, gems, and the json gem installed
function jsonator {
ruby -rubygems -r pp -e 'require "json"; ARGF.each {|l| puts JSON.pretty_generate(JSON.parse(l))}'
}
function jsoncurl {
curl -s $@ | jsonator
}
function jsontwurl {
twurl -s $@ | jsonator
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment