Cat Rss
Class Cat Rss
Simple class for print rss file.
Click HERE for see the code of this class
< ?php
// Include the library
include('cat-rss.inc.php');
// Inizialize the class
$rss = new Cat_Rss('Feed Title', 'feedPath' , 'feed desc, array('language'=>'en_EN'));
// Check if there is a logo feed
if (file_exists('rss-logo.jpg')) {
// Add feed image
$rss->add_image('feed title', 'rss-logo.jpg', 'http://url-file-feed');
}
$rss->add_article('title news', 'http://link-to-the-news', 'text of the news ...', 'lastmodify-date', array('guid'=>'http://link-to-permanent-link'));
$rss->add_article('title news', 'http://link-to-the-news', 'text of the news ...', 'lastmodify-date', array('guid'=>'http://link-to-permanent-link'));
$rss->add_article('title news', 'http://link-to-the-news', 'text of the news ...', 'lastmodify-date', array('guid'=>'http://link-to-permanent-link'));
// Take the xml file
$fileXml = $rss->get_rss();
// set header
header("Content-type: application/xml");
// Print rss
echo $fileXml;
$rss->__destruct();
?>

Size: 2.37 KB
Hits : 7
Hits : 7
No Comments »
RSS feed for comments on this post. TrackBack URL
