XML.com: XML From the Inside Out
oreilly.comSafari Bookshelf.Conferences.

advertisement

Programming Web Services with XML-RPC
Pages: 1, 2, 3

Meerkat: O'Reilly's Technology Database

The Meerkat web application (http://meerkat.oreillynet.com/) is O'Reilly & Associates' database of headlines from technology sites around the Web. (O'Reilly & Associates is known, among other things, for the animal-themed cover designs of the books they publish. Meerkat's name carries on this tradition among O'Reilly's online offerings.) The Meerkat database aggregates the title, description, and URL of technology news stories and other resources from XML files, using the RDF Site Summary (RSS) format.[5] Each site creates an RSS file, which Meerkat retrieves and adds to its database. Meerkat organizes the web sites ("channels") into categories, according to the subject matter they cover. Figure 5-1 shows a screenshot of Meerkat, displaying stories in its "XML" category

In addition to its web interface, Meerkat provides an XML-RPC interface that gives access to its content. A well-structured PHP program normally abstracts its functionality into classes, which contain the program logic and separate activation of those classes in conjunction with HTML markup. XML-RPC for PHP can take advantage of that structuring, enabling you to add a web application interface easily by writing simple wrappers for your existing program logic. Meerkat is an example of an application that has done just that.

Figure 5-1. Meerkat showing stories from its "XML" category

 

Meerkat's interface offers the following methods, three of which are used in Example 5-3:

meerkat.getCategories( )
Returns an array of structs of available Meerkat categories (member "title"), each with its associated category ID (member "id").

meerkat.getChannels( )
Returns an array of structs of available RSS channels (member "title"), each with its associated channel ID (member "id").

meerkat.getChannelsByCategory(category_id)
Returns an array of structs of RSS channels in a particular category (specified by integer category ID), each with its associated channel ID.

meerkat.getItems(recipe)
Returns an array of RSS item structs, given a "recipe" struct. See http://www.oreillynet.com/pub/a/rss/2000/11/14/meerkat_xmlrpc.html for Meerkat info.

5. Resources and tutorials for RSS can be found on the O'Reilly Network Syndication DevCenter at http://www.oreillynet.com/rss/.

Pages: 1, 2, 3

Next Pagearrow