Skip to content

Instantly share code, notes, and snippets.

@boecko
Created April 27, 2011 09:28
Show Gist options
  • Save boecko/943975 to your computer and use it in GitHub Desktop.
Save boecko/943975 to your computer and use it in GitHub Desktop.
JSON Decoding on cmdline (ruby)
curl url | ruby -e "require 'rubygems'; require 'json'; puts JSON.pretty_generate(JSON[STDIN.read]);"
cat file | ruby -e "require 'rubygems'; require 'json'; puts JSON[STDIN.read]['serverStatus']['uptime'];"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment