Oct
13
2008

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();
?>
download
Size: 2.37 KB
Hits : 7

Share and Enjoy:
  • Facebook
  • del.icio.us
  • Twitter
  • Google Bookmarks
  • Digg
  • Technorati
  • MySpace
  • Live
  • BlinkList
  • Add to favorites
  • email
  • RSS
  • Mixx
  • Bitacoras.com
  • blogmarks
  • Blogosphere News
  • Blogplay
  • connotea
  • Current
  • Diggita
  • Diigo
  • DZone
  • eKudos
  • Internetmedia
  • LinkedIn
  • MSN Reporter
  • Reddit
  • Scoopeo
  • Segnalo
  • Slashdot
  • Socialogs
  • Sphinn
Written by Davide in: Library,php | Tags: , ,

No Comments »

RSS feed for comments on this post. TrackBack URL

Leave a comment

Theme: TheBuckmaker.com Magazine Style Templates