Skip to content

Instantly share code, notes, and snippets.

@themattharris
Created June 13, 2010 11:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save themattharris/436600 to your computer and use it in GitHub Desktop.
Save themattharris/436600 to your computer and use it in GitHub Desktop.
# Thanks to Mark McBride for jsonator syntax
function jsoncurl {
curl -s $@ | jsonator
}
function jsontwurl {
twurl $@ | jsonator
}
function obtwurl {
twurl $@ | objenator
}
function jsonator {
ruby -rubygems -r pp -e 'require "json"; ARGF.each {|l| puts JSON.pretty_generate(JSON.parse(l))}'
}
function objenator {
ruby -rubygems -r pp -e 'require "json"; pp JSON.parse(ARGF.read)'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment