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:

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.
Forum

Display Images with Common RSS Reader?

2011-06-02 06:24:52

sportbilly

Hi, can i display Images with Common RSS Reader? thank you
2011-06-07 03:12:27

scriptol

Hello, There is no image tag nor in the RSS 2.0 spec neither in the Atom spec, even if a such tag exists for the channel. But image are displayed automatically when including in the summary with the HTML img tag.

Server specifications for commonlib, rsslib

2010-05-02 09:52:56

wattaman

Hi! I've just reinstalled my server switching from Ubuntu to Centos 5 and the commonlib script is not working any more. I know is nothing wrong with the script - is something with the server configuration but I can't find out what. So, maybe someone can help me here and answer and tell me what are the requests for the commonlib script to work so I can skip checking everything again and go to the problem. I've tried hundreds of configurations until now, enabling and disabling functions in php.ini and httpd, nothing seems to work for me. I have php 5.1.6 and Apache 2.2.3 for what it matters. I really hope to fix this soon. Thank you! Sorrty, I've forgot to include the error php writes on the page. So, here it is: Fatal error: Class 'DOMDocument' not found in /home/site/public_html/commonlib.php on line 127 And for the rsslib.php: Fatal error: Class 'DOMDocument' not found in /home/site/public_html/rss.php on line 71 I've searched Google a little and everybody say that I must have the xmlrpc and the php-xml installed on my server. Well, they are installed :( I have no clue what to do next
2010-05-03 02:59:43

wattaman

OK, got it working. In Centos 5 it appears that the php-xmlrpc is not enough and one should install the php-xml to make it works. Also, allow_url_fopen must be On in php.ini. cheers!

Removing data at the top

2009-09-19 03:24:29

user24

Hi; I have download your great commonlib rss reader and try it. But I have question, each time I retrieve rss data, a link of the websites that I used to retrieve data from it appears at the top ( i.e the first entry of the rss feed) The question is : how can I remove the first link
2009-09-19 03:36:10

scriptol

Hello, Yes, you want to remove the link to the website and the description? In the Common_display function, replace this line:
$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...

Common Reader problem.

Feed as URL for browsing.