cool this is what i got and it appears to work as i waited for 5 mins for it to check for new material
<?
// Cache time in seconds
define('CACHE_TIME', 5 * 60);
// Where we store a local copy of the feed for caching purposes
define('CACHE_FILE', 'feed.cache');
// Where the live feed is located
define('FEED_URL', 'http://www.rfstats.com/server_status/feed.txt');
// Is our cache file new enough to use?
if (time() - filemtime(CACHE_FILE) < CACHE_TIME)
{
// Use cache
$data = file_get_contents(CACHE_FILE);
} else {
// Cache expired, download new copy, and grab its contents ($data)
$data = file_get_contents(FEED_URL);
$fp= fopen(CACHE_FILE, 'w');
fwrite ($fp, $data);
fclose($fp);
}
$new = 'Login1';
$end = 'S|';
if ( ( $pos = strpos ( $data, $new ) ) !== false )
{
$text = substr ( $data, ( $len = ( $pos + strlen ( $new ) ) ), ( strpos ( $data, $end, $len ) - $len ) );
$l = str_replace('L|', '<br>', $text);
$p = str_replace('P|', '<br>', $l);
$g1 = str_replace('G|[1] ', '<br>', $p);
$g2 = str_replace('G|[2] ', '<br>', $g1);
$g3 = str_replace('G|[3] ', '<br>', $g2);
$off = str_replace('|0|', ' <img src="down.jpg"> ', $g3);
$on = str_replace('|1|', ' <img src="up.jpg"> ', $off);
echo "Login1" .$on;
}
else
{
echo 'Error Site may have a problem pulling the server status';
}
?>
anyone have any suggestions on anything or how to improve my sloppy code