[Work on ch23 John Goerzen **20080213001506] { hunk ./en/ch23-webclient.xml 4 - Web client programming + Extended Example: Web Client Programming + + By this point, you've seen how to interact with a database, parse + things, and handle errors. Let's now take this a step farther and + introduce a web client library to the mix. + + + We'll develop a real application in this chapter: a podcast + downloader, or "podcatcher". The idea of a podcatcher is simple. + It is given a list of URLs to process. Each URL provides an XML + file in the RSS format. Inside this XML file, we'll find + references to URLs for audio files to download. + + + Podcatchers usually let the user subscribe to podcasts by adding + RSS URLs to their configuration. Then, the user can periodically + run an update operation. The podcatcher will download the RSS + documents, examine them for audio file references, and download + any audio files that haven't already been downloaded on behalf of + this user. + + + Users often call the RSS document a podcast or the + podcast feed, and each individual audio file an episode. + + + + To make this happen, we need to have several things: + + + An HTTP client library to download files + + An XML parser + + A way to specify and persistently store + which podcasts we're interested in + + A way to persistently store which podcast episodes + we've already downloaded + + + hunk ./en/ch23-webclient.xml 47 - FIXME + + The last two items can be accomodated via a database we'll set up + using HDBC. The first two can be accomodated via other library + modules we'll introduce in this chapter. + + + + The code in this chapter was written specifically for this + book, but is based off code written for hpodder, an existing + podcatcher written in Haskell. hpodder has many more features + than the examples presented here, which make it too long and + complex for coverage in this book. If you are interested in + studying hpodder, its source code is freely available at . + + + }