Common Feed Reader - Script of a RSS/Atom reader
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: https://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:
- Atom 1.0
- RSS 2.0
- RSS 0.91, 0.92, 0.94
- RSS RDF 1.0
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:
- url:
the address of the XML file. - size:
the maximum number of items to display. The default is 25. - channel-option:
true if the chanel is displayed, false elsewhere. Default true. - desc-option:
true if the descriptions are displayed or else false. Default true. - 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.
- Common Reader. The script requires PHP 5.
- Demos included:
- Displaying an RSS/Atom/RDF feed directly.
- Using a form to select the parameters of the display.
Documentation
- The Common RSS interface. Short manual.
Display Images with Common RSS Reader?
sportbilly
scriptol
Server specifications for commonlib, rsslib
wattaman
wattaman
Removing data at the top
user24
scriptol
$recents = array_slice($Common_Content, 0, $size);by
$recents = array_slice($Common_Content, 1, $size);This should work. All the data for each links are stored in a same array, and the link to the site is the first entry in this array.
Forum continued...