Share » Learn » eZ Publish » How to Import and Export RSS Feeds

How to Import and Export RSS Feeds

Wednesday 20 August 2008 12:14:00 pm

  • Currently 5 out of 5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

The broad process for importing RSS feeds involves:

  1. Selecting an RSS feed to import
  2. Configuring eZ Publish to run a PHP cronjob script so that eZ Publish can periodically collect RSS information from an external URL
  3. Creating a content class whose objects will hold the RSS items
  4. Configuring eZ Publish RSS import features to automatically generate these new objects from an RSS feed
  5. Creating a custom template(s) to display the imported RSS items effectively

Selecting an RSS feed to import

The first step is to select an RSS feed to be imported into eZ Publish. If available, RSS feeds are usually indicated by descriptive links or images similar to the RSS logo shown below.

RSS logo

You might find useful RSS feeds by doing a web search for “+RSS +(topic of interest)”, or by searching feed directory sites like www.rssfeeds.com or Syndic8.

This article uses a tennis RSS feed from BBC Sport. The URL of this RSS feed is http://newsrss.bbc.co.uk/rss/sportonline_world_edition/tennis/rss.xml.

Viewed in a web browser, the main part of this feed appears as follows.

Example RSS from BBC Sport

Basically, an RSS feed contains general information about the feed as well as the individual RSS items, as shown below.

Example RSS sections

The format of an RSS feed conforms to the RSS specification (for more information, see Wikipedia: RSS, RSS 2.0 Specification at Harvard Law, or the RSS Advisory Board). The main data elements in an RSS feed item include a title, link, description, and publication date. RSS feeds can also include elements such as:

  • Copyright information
  • Feed image data
  • Author name and email address
  • A link to comment pages for each content item

Note that eZ Publish RSS importing does not handle elements that use XML namespaces (such as <content:encoded> and <dc:creator>). This is because these elements are an extension of the RSS 2.0 specification, not a part of it. These elements come up in many news (such as the BBC RSS feed used in this guide) and some blog system feeds. Basically, if an element has a colon in its XML tag name, it cannot be imported. (For background information about namespaces, see this article on extending RSS 2.0 and creating custom attributes.)

RSS feed copyright, attribution and terms of use

RSS feeds typically have copyright and terms of use information associated with them. This may be indicated in the feed itself (for example, in <copyright> tags), and/or on the site where you found the RSS feed. Pay close attention to this information. Looking at the "BBC RSS Feed Standard License Terms" associated with the example feed we are using, some of the terms of use include:

  • Crediting the BBC as the source of content
  • Linking back to the BBC site and content
  • A requirement that use is non-commercial
  • A requirement that the BBC trademark is not used on your site

If you plan to export your own RSS feeds (described later in this article), it is a good idea to specify your RSS feed's terms of use too. You can use standard licensing schemes like Creative Commons or seek legal advice for stricter needs.

Printable

Printer Friendly version of the full article on one page with plain styles

Author(s)