lastRSS.php

CZE | ENG

About

lastRSS.php is simple yet powerfull PHP class to parse RSS/RDF files v0.9/0.91. Uses quick regullar expressions. Result is associative array with RSS fields.

Features:

Future plans:

Download

Synopsis

There are only two public methods in the lastRSS.php class - SetCache() and Get().

Properties (public variables)

$lastRSS->cache_dir
Folder in which cached data should be stored. Remember to chmod this folder to 777. Set $cache_dir to "" (empty string) to disable transparent cache.
$lastRSS->cache_time
Cache interval in seconds. Don't set this lower than 1200 (20 minutes) - webmasters will hate you otherwise. Optimal value is between 7200 and 14400 (2 - 4 hours) in my opinion.

Methods (public functions)

Get($rss_url)
Load and parse RSS file $rss_url (e.g. "http://slashdot.org/slashdot.rdf"). Ofcourse use cached version of file if cache is enabled and cached file is fresh enough. Returns associative array of RSS fields. Simply use print_r() function to see structure of the result (see Demo 1).

Examples

Demo 1 - Show structure of result array using print_r() - (Slashdot RSS as an example).
(Demo 1 | Source code)

Demo 2 - Show RSS of Freshmeat RSS in nice look.
(Demo 2 | Source code)

Demo 3 - Very simple RSS agregator using lastRSS
(Demo 3 | Source code)

Author

Questions? Comments?

Vojtech Semecky, webmaster@webdot.cz

License

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License (GPL) as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Changelog

Verze 0.2 - (29 June 2003)
Bugfix: Bad caching of temporary unreachable RSS files
Version 0.1.1 - (11 May 2003)
Initial release

Stuff

Text link
http://www.webdot.cz/lastrss/

Powered by button 88x31
lastRSS button 88x31

This document is valid XHTML 1.0 Strict and valid CSS 2.
This document is also friendly to text browsers, very old browsers, PDA devices and printers.