Created
July 6, 2016 18:46
-
-
Save johnmaxwell/67e77f213090b838776eea557e712cf9 to your computer and use it in GitHub Desktop.
Curl some JSON and then print it out all pretty-like
This file contains 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
curl "http://jsonip.com" | ruby -e "require 'json'; puts JSON.pretty_generate(JSON.parse(STDIN.gets))" | |
# { | |
# "ip": "....", | |
# "about": "/about", | |
# "Pro!": "http://getjsonip.com" | |
# } | |
# Here's one that copies it straight into your clipboard (on the Mac) | |
curl "http://jsonip.com" | ruby -e "require 'json'; puts JSON.pretty_generate(JSON.parse(STDIN.gets))" | pbcopy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment