RSS Specification -

RSS Specification  :: RSS feeds, RSS syndication, Create RSS, RSS marketing, RSS and money, RSS fields and more

 

 

 

Home
Our Award
Latest RSS News
What is RSS?
Why Use RSS?
RSS History
RSS Specification
How to Read RSS?
How to Create RSS?
RSS Marketing
RSS Fields
RSS Articles
Promote RSS Feed
RSS Feed and Money
Tutorials and Manuals
RSS Feeds
RSS Blogs
RSS Statistics
RSS on Your Website
RSS Buttons
RSS and PHP
What is Podcasting?
Create Podcast?
iTunes Specification


Feed Editor - Simply the best RSS feed creator and editor

 

 

RSS and PHP

 

If you want to display your (or other's) news at your website – you will be amazed by how simple it is.

 

 

// caching the RSS file
// place where to store the cache file

$filename = $_SERVER['DOCUMENT_ROOT']."/cache/phpnews.rss";

// checking how old the file is
$modif=time()-@filemtime ("$filename");

// if there is no file in the cache or it is too old - update it
if(!file_exists($filename) || $modif>"3600")
  {
   $rss = file_get_contents("http://www.php.net/news.rss");
    
   $handle = fopen ("$filename", "w");
   
   fwrite($handle, $rss);
    
   fclose($handle);
  }

// importing the RSS library from the PEAR package
require_once("XML/RSS.php");
    
    $rss =& new XML_RSS("$filename");

    $rss->parse();
                       
    foreach ($rss->getItems() as $value) {

// making the news string
$page = $page."<b>".$value['dc:date']."</b><a href=\"".$value['link']."\" class=\"menu\">"." ".$value['title']. "</a><br>" .$value['description'] . "\n";
    }   

// displaying the result
echo"$page";

 

 

This script demonstrates the basic idea of working with RSS files. If you want to use a ready-made solution, Feed2Html is exactly what you need.

 

 

 

See also: RSS aggregator, RSS feeds, RSS specifications.

 

 

 


Create RSS Feed | Make RSS | RSS Directory | RSS Software | RSS Forum | RSS to HTML | RSS Generator