Script of a feed reader for any format

This library holds only a single function that is able to display any feed in any format.
The URL of the file may be local, in the form: rss.xml, or remote in the form: http://www.scriptol.com/rss.xml.
The function displays the channel and the articles and for each of them the title, the description and the dates.

The date is not displayed for the RSS RDF 1.0 format because it is not a part of the core specification.

The script is compatible with:

The interface

The interface is comprised of a single function:

Common_Display(url, size, channel-option, desc-option, date-option)

The interface requires one argument, the url, and supports four optional arguments:

  1. url:
    the address of the XML file.
  2. size:
    the maximum number of items to display. The default is 25.
  3. channel-option:
    true if the chanel is displayed, false elsewhere. Default true.
  4. desc-option:
    true if the descriptions are displayed or else false. Default true.
  5. date-option:
    true if the dates are displayed or else false. Default false.

How to display only the link on the site

To display only links on articles, replace in the Common_Display function this line:

$recents = array_slice($Common_Content, 0, $size);

by:

$recents = array_slice($Common_Content, 1, $size);  

Download

The archive holds the script and the demos.

Documentation

Licence: Mozilla 1.1.