Work From Home
Home

Index
 

 Adventure Holiday Chat rooms
 Domains
 
Fishing
 
Free ringtones Free web design  Medical science Medical supplies Movies DVD   Money /Finance    Online games  Online shopping Pathology Pharmacy PayPal Safaris      Security Sedo      Sex info Sexy singles  Travel    

 
 
 
   
 
 
   
   
 
 
   
   

                         

  CACHE YOUR RSS FEED

   How to create a cache file for RSS XML files   

It is well documented that RSS feeds can significantly increase website traffic. Not only do you want primary viewers but have customers come back time and time again because your web page content is continually updated. This is exactly what you need for your job at home or work from home internet business.

The Cache script can be used by webmasters utilising any RSS to HTML PHP Script to decrease the display time of RSS feeds and the time taken for web pages to load. Some RSS feed makers stipulate in their conditions of use, a limit on the number of times their RSS feed can be downloaded per hour. As you have no control over viewers timing of visits to your website, you also need to manage this aspect otherwise the RSS makers may ban you!
 
By using the PHP script below together with any RSS to HTML scripts, instead of just a JavaScript code on your web page, you increase page loading speed and your imbedded RSS feed displayed is spidered and the content included in the search engine and page ranking processes. 
 
 
<?php
/*
==================================================
Cachemate script to output contents of a RSS XML file and save to your server
Author: domain.e-pond.info
Created: Sept 2007. Updated
: Oct 2007
==================================================
*/
header('Content-type: text/xml');
// --------------------------------------------------------------
$cachefolder="cachemate"; //path to cache directory. No trailing "/". Set dir permission to read/write!
// --------------------------------------------------------------
// Determine which RSS file to actually fetch
// -------------------------------------------------------------

$rssurl= "http://www.e-pond.info/greentreefrogblog/YaBB.pl?action=rss";
$localfile= "rssmate.xml"; //Name cache file based on RSS URL
// --------------------------------------------------------------
// Do not edit script below
$cacheminutes=(int) $_GET["1"];
// --------------------------------------------------------------
// fetchfeed() gets the contents of an external RSS feed,
// and saves its contents to the "cached" file on the server
// --------------------------------------------------------------
function fetchfeed(){
global $rssurl, $localfile;
$contents=file_get_contents($rssurl); //fetch RSS feed
$fp=fopen("/home/ewcg/public_html/cache/rssweather.xml", "w");
fwrite($fp, $contents); //write contents of feed to cache file
fclose($fp);
}
// --------------------------------------------------------------
// outputrsscontent() outputs the contents of a RSS feed using the cached local RSS file
// It checks if a cached version of the RSS feed is available, and if not, creates one first.
// --------------------------------------------------------------
function outputrsscontent(){
global $rssurl, $localfile, $cacheminutes;
if (!file_exists($localfile)){ //if cache file doesn't exist
touch($localfile); //create it
chmod($localfile, 0666);
fetchfeed(); //then populate cache file with contents of RSS feed
}
else if (((time()-filemtime($localfile))/60)>$cacheminutes) //if age of cache file great than cache minutes setting
fetchfeed();
readfile($localfile); //return the contents of the cache file
}
outputrsscontent();
?>
 

 
All you need to do now is set up a Cron Job at intervals appropriate for frequency required and that abides by the conditions of use for any RSS feed you want.
 
Command example:
/usr/local/bin/php -f /home/username/public_html/cachemate/cachemate.php
 
There are a number of RSS to HTML converter scripts available - even free, for the next step of getting the XML file displayed on your web page.
 
 
                                                                   
hopRSS

Work from Home:

     More resources...

Holiday Marketing Guide.
The Best Marketing Tool On The Market Today! The 2009 Weird & Wacky Holiday Marketing Guide Is The Ultimate Marketing Resource For Your Business.
The Article Marketing Handbook.
Brand New Article Marketing Handbook Rocking The Article Marketing World! 100% White-Hat Secrets And Techniques For Todays Marketers That Have Never Been Seen Before. This Is The Future Of Article Marketing. Get On The Bandwagon! $23.50 Commission Per!!!
Information Marketing Made Easy With Lisa Angelettie.
Earn A 50% Commission On Article Marketing Membership Site And Other Information Marketing Products For Newbies.

                             Bring targeted traffic to your site with Google AdWords.
 
Further Resources :
  
How to find profitable Domain names  
Free ebooks
Affiliate marketing
Money, Wealth and Positive Thinking
Top Search Engine Rankings
Sitemap Generator
Robots.txt file and Sitemaps
Backup websites using cPanel and Cron jobs
RSS Feeds: How to create one for your site 
Creating External JavaScript files  
WAHM (Work At Home Moms) - SBI! Businesses
Work From Home
Affordable, Cheap, Reliable, Web Hosting
Total Domain Management System
Webmasters Earn Money Here!
    
Google
 
 
   

Copyright 2007 domain.e-pond.info. All Rights Reserved

Privacy Policy: Your privacy is important to us. No personal information is recorded in the use of this site.

 

Sitemap