Friday, February 25, 2011

One Liner: Pretty Print, Syntax Highlight and Page Online XML Data

Useful when leaching a bunch of video clips from YouTube:
curl -s "http://gdata.youtube.com/feeds/api/playlists/916175AB005C0FB6" | xml_pp | pygmentize -l xml | less -R
(required packages: curl, xml-twig-tools, python-pygments)

Actually, xml-pp isn't really needed with YouTube - it can do the pretty-printing for you:
curl -s "http://gdata.youtube.com/feeds/api/playlists/916175AB005C0FB6?prettyprint=true" | pygmentize -l xml | less -R

No comments:

Post a Comment