The primary duty of an exception handler is to get the error out of the lap of the programmer and into the surprised face of the user. Provided you keep this cardinal rule in mind, you can't go far wrong.
Suppose you want to download the top 5 most watched videos with title containing "FOOBAR" in category Music. Using the youtube feeds protocol you can do something like this:
xmllint --format will obviously format the downloaded XML file so we can easily extract the needed URL of the video located under the "media:player" tag.
Next we pipe the output the clive which will know how to handle the url and retrieve the flv file. Optionally you can pipe it to get_youtube_vids.awk if it accepts downloading multiple files, however clive has more options and can even encode the vids after download :)
I am being sponsored by Syntress! They bought me an amazing dedicated server to run catonmat on. If you're looking web services, I highly recommend the Syntress guys!
Suppose you want to download the top 5 most watched videos with title containing "FOOBAR" in category Music. Using the youtube feeds protocol you can do something like this:
xmllint --format will obviously format the downloaded XML file so we can easily extract the needed URL of the video located under the "media:player" tag.
Next we pipe the output the clive which will know how to handle the url and retrieve the flv file. Optionally you can pipe it to get_youtube_vids.awk if it accepts downloading multiple files, however clive has more options and can even encode the vids after download :)
Reply To This Comment