wiki:GettingStartedWithFeeds

It is really very easy to get feeds out of openguides. In fact, many openguides will include RSS links all over the place, just to help you.

Generally speaking, just adding ;format=rss or ;format=atom onto a normal url is all that is required to get an RSS or Atom feed of that page.

Different Feeds

  1. Recent Changes
  2. Searches
  3. Normal Pages (Nodes)
    1. Metadata
    2. Node content
    3. Node Versions
  4. Locale / Category Listings
  5. Everything

Recent Changes

You can get to the recent changes list by adding ?action=rc onto the wiki link, and then the RSS feed by adding ?action=rc;format=rss or the Atom feed by adding ?action=rc;format=atom . For example, http://cotswolds.openguides.org/wiki/wiki.cgi?action=rc becomes http://cotswolds.openguides.org/wiki/wiki.cgi?action=rc;format=rss.

The RSS version contains lots of useful information. Firstly, it contains a list of the links to the recently changes pages. Then, for each changed page, it contains lots of metadata, including:

  • A link to the page
  • The title of the page
  • Who edited the page, and what comment they included on the change
  • When it was edited
  • If this was a new page, a minor edit or a major edit
  • What categories the page belongs to (held in dc:subject)
  • A link to the rdf of the page

The Atom version doesn't contain quite as much information as the RSS version (we're still waiting on a ModWiki extension for Atom). You get metadata including:

  • A link to the page
  • The title of the page
  • When it was edited
  • What categories the page belongs to
  • A link to the rdf of the page

It is also possible to constrain recent edits to just one user. Such feeds will contain all the information above, but be specific to just one editor. Simply add ;username=(User) to the link, eg http://cotswolds.openguides.org/wiki/wiki.cgi?action=rc;format=rss;username=NickBurch

Searches

When searching, you can request the results as RSS or Atom. The feed is similar to a recent changes feed, but contains less information (as the search code doesn't generally work with the full nodes). You can request such a feed by adding ;format=rss or ;format=atom to a search url (search.cgi). If you're building one from scratch, the following arguments may be passed:

  • search - the text to search for
  • os_dist - the distance (in meters) from the OS x+y that the node must be within
  • os_x - the OS x to search around
  • os_y - the OS y to search around
  • latlong_dist - the distance (in meters) from the lat+long that the node must be within
  • latitude - the latitude to search around
  • longitude - the longitude to search around
  • format - rss or atom

The feeds contain the following entries:

  • A link to the page
  • The title of the page
  • How far it is (in meters) from the search location, if constraining by distance
  • A link to the rdf of the page

eg http://cotswolds.openguides.org/wiki/search.cgi?search=news&os_dist=99999&os_x=436373&os_y=218688&latlong_dist=99999&latitude=&longitude=&go=Go&format=rss (all the nodes with news in their name near Charlbury) or http://cotswolds.openguides.org/wiki/search.cgi?search=oak;format=atom (all the nodes with Oak in their name)

Normal Pages (Nodes)

Metadata

For any node, you can request the RDF version of the node, simply by adding ;format=rdf to the url, such as http://cotswolds.openguides.org/wiki/wiki.cgi?The_Bull_Inn,_Charlbury becomes http://cotswolds.openguides.org/wiki/wiki.cgi?id=The_Bull_Inn%2C_Charlbury;format=rdf.

The RDF version again contains lots of useful information, such as:

  • What categories the node belongs to
  • What locales the node belongs to
  • What the address, phone number etc of the place are
  • What the lat and long of the place are (and what the OSGB x and y values are, UK only)
  • Who last edited the node
  • What hours the place is open

In fact, the RDF version should contain all the metadata in some format or other.

Node content

You can get the raw wikitext (the canonical version of the node content - ie everything else but the metadata) by adding ;format=raw to the URL, such as http://cotswolds.openguides.org/wiki/wiki.cgi?The_Bull_Inn,_Charlbury becomes http://cotswolds.openguides.org/wiki/wiki.cgi?id=The_Bull_Inn%2C_Charlbury;format=raw.

Node Versions

You can get a feed in the style of "recent changes" for all the versions of a node. It contains the metadata on the versions, but not the content (see above for how to do that).

To request this, just add ;format=rss or ;format=atom to the end of the node versions url. For example, http://cotswolds.openguides.org/wiki/wiki.cgi?action=list_all_versions;id=John_Brain_Butchers becomes http://cotswolds.openguides.org/wiki/wiki.cgi?action=list_all_versions;id=John_Brain_Butchers;format=atom

Locale / Category Listings

It is possibly to get a feed of all the nodes in a locale or category, or even a list of all the locales and categories. This is done through action=index . These listings are available as rss, atom or rdf, with a suitable format parameter. Use the parameter index_type=.... to select either category or locale, an put the category/locale name in index_value=.....

Depending on the format requested, you will get slightly different information back in the feed. You should always get:

  • What categories the node/category/locale belongs to (for Category/Locale? listings, this should be Categories/Locales?)
  • What locales the node/category/locale belongs to
  • What the address, phone number etc of the place are
  • What the lat and long of the place are (and what the OSGB x and y values are, UK only)
  • Who last edited the node

Everything

Sometimes, you want to dump out a whole guide in an XML format, eg when importing into something else. Details to follow

It is possible to get a list of all the different nodes in the system from action=index , in rss, rdf or atom formats. From this list, you can get the rdf urls for all the nodes, and fetch those. An example link is http://cotswolds.openguides.org/wiki/wiki.cgi?action=index;format=atom

Ivor has also written a script to import a complete guide (minus revision history) using the RDF feeds and raw output mode.

Last modified 11 years ago Last modified on Jul 13, 2006, 4:00:33 PM