subject: How To Add Rss Feeds Into Your Website Using Php [print this page] Hello Friends, Hello Friends,
As a webmaster you would interested in having search engine friendly RSS feeds on your web pages because this can help with;
RSS in Javascript format is available from most RSS Publishers but what they do not tell you is that Javascript is not search engine friendly. What that means is search engines do not read Javascript. Any thing placed on your web pages in javascript format won't be read by the indexing search engines. That is why they offer our feeds in PHP. PHP is a search engine friendly scripting language. Adding RSS feeds to your web pages with PHP will provide fresh content for the search engines to choose up and rank you for.
PHP is server side scripting. That means it is parsed on the server before your page lots in the browser. To the visitor and to the search engines PHP scripts are not noticeable. When PHP is combined with RSS feeds it is a powerful idea. With PHP and RSS you can add other people's content to your web pages and the search engines will see it and think it is part of your net site! That free RSS content when placed on your web page with PHP will fundamentally become a part of your web-site and bring you more traffic. That is why they recommend that you add the feeds to your net site with PHP in lieu of Javascript. Follow the instructions below to add the code to your web pages. Getting spidered more often Rating higher in the search engines Adding Relevancy to your web page.
I had a lot of trouble trying to add RSS Feeds on my website. Eventually I came across these codes and they were very helpful.
PHP Code:
----------------------
class RSSFeed {
// VARIABLES
// channel vars
var $channel_url;
var $channel_title;
var $channel_description;
var $channel_lang;
var $channel_copyright;
var $channel_date;
var $channel_creator;
var $channel_subject;
// image
var $image_url;
// items
var $items = array();
var $nritems;
// FUNCTIONS
// constructor
function RSSFeed() {
$this->nritems=0;
$this->channel_url='';
$this->channel_title='';
$this->channel_description='';
$this->channel_lang='';
$this->channel_copyright='';
$this->channel_date='';
$this->channel_creator='';
$this->channel_subject='';
$this->image_url='';
}
// set channel vars
function SetChannel($url, $title, $description, $lang, $copyright, $creator, $subject) {
I also discovered that there was a cron script that runs every now and then that writes the output to a an xml file. It ran through a feed validator and was validated.