curling through web services can be tedious without some basic pretty printing. Let's see how easy it is to create aliases for pretty printing json/xml formats with Python's pygments library and xmllint/jsonp.
alias xml='xmllint --format - | pygmentize -l xml -O encoding=utf8'
alias json='jsonpp | pygmentize -l json -O encoding=utf8''
Then just curl http://wservice.viabicing.cat/getstations.php\?v\=1 | xml
or curl https://b83c5a5e-d575fbfbad2f.my.apitools.com | json
to get nice XML/JSON output.
You need xmllint (part of libxml, on osx by default), pygments (easy_install pygments
), jsonpp (brew install jsonpp
on osx, http://jmhodges.github.io/jsonpp/ otherwise).