Ok, I've written a very simple script to get the top 21 RuneScape hiscores. The finished product of this will be a website where you can get a Userbar showing your favorite top 21 player and their XP. I'm going to use the information in PHP GD to make the Userbars. The code is very simple:

<?php
$url = "http://hiscore.runescape.com/overall.ws?table=0&category_type=0";
$scrape = file_get_contents($url);
$lines = array("\t","\n","\r","\x20\x20","\0","\x0B");
$stuff = str_replace($lines, "", html_entity_decode($scrape));
$begin = strpos($stuff,'<table class="table_back">');
$end = strpos($stuff,'</table>',$begin) + 8;
$table = substr($stuff,$begin,$end-$begin);
echo $table;
?>

I'm asking for a little help on isolating a 2 results per person. So I remove the titles, the rank number, and the level, leaving just a list of all the names and the XP.

Thanks in advance,
Infestor1

    Bump, this is on the second page and I haven't gotten a reply yet...

      I've not looked at the page in question, so this might not apply, but normally I would probably use [man]preg_match_all/man to isolate the data of interest, using a sub-pattern in the regular expression for each specific piece of data I want to extract. You might want to use PREG_SET_ORDER for the optional "flags" argument to make it easier to sort through the results.

        Write a Reply...