Created
August 10, 2012 23:50
-
-
Save mccv/3319045 to your computer and use it in GitHub Desktop.
jsonator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# stick this in .bashrc | |
# jsoncurl <thing that outputs json on one line so you can't read it> | |
function jsonator { | |
ruby -rubygems -r pp -e 'require "json"; ARGF.each {|l| puts JSON.pretty_generate(JSON.parse(l))}' | |
} | |
function jsoncurl { | |
curl -s $@ | jsonator | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment