Scriptdaemon
04-29-2007, 10:15 AM
I've made a basic code to load my Xfire profile so I can determine whether I am online or offline on my own site, but it seems my way of doing it is inefficient, as it loads rather slow. Anyone have any tips as to how I can tweak this to make it a lot faster? (This function is taken from a class I put it in, hence the $this variables.)
function xfire_status() {
if($this->xfile = @file('http://www.xfire.com/profile/scriptdaemon')) {
$status = implode('', $this->xfile);
if(strpos($status, '<strong>Last Seen</strong>')) {
echo '<img alt="Online" border="0" src="images/offline.png" />';
} else {
echo '<img alt="Offline" border="0" src="images/online.png" />';
}
} else {
echo '<img alt="Offline" border="0" src="images/offline.png" />';
}
}
function xfire_status() {
if($this->xfile = @file('http://www.xfire.com/profile/scriptdaemon')) {
$status = implode('', $this->xfile);
if(strpos($status, '<strong>Last Seen</strong>')) {
echo '<img alt="Online" border="0" src="images/offline.png" />';
} else {
echo '<img alt="Offline" border="0" src="images/online.png" />';
}
} else {
echo '<img alt="Offline" border="0" src="images/offline.png" />';
}
}