Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $elapsed=file_exists("cache/dps.cache")?filemtime("cache/dps.cache"):0;
- if (time() - $elapsed > 60*5)
- {
- $fp=fopen("http://www.worldoflogs.com/guilds/67175/rankings/players/","r");
- $html=stream_get_contents($fp);
- fclose($fp);
- $html=str_replace("<a href='/","<a href='http://www.worldoflogs.com/",$html);
- $dps_start=strpos($html,"<table class='playerRankMixed'>");
- $dps_end=strpos($html,"</table>",$dps_start);
- $heal_start=strpos($html,"<table class='playerRankMixed'>",$dps_end);
- $heal_end=strpos($html,"</table>",$heal_start);
- $dps=substr($html,$dps_start,$dps_end-$dps_start)."</table>";
- file_put_contents("cache/dps.cache",$dps);
- echo $dps;
- $heal=substr($html,$heal_start,$heal_end-$heal_start)."</table>";
- file_put_contents("cache/heal.cache",$heal);
- echo $heal;
- }
- else
- {
- echo file_get_contents("cache/dps.cache");
- echo file_get_contents("cache/heal.cache");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement