All pastes #986835 Raw Edit

Mine

public text v1 · immutable
·published 2008-04-16 00:43 UTC
rendered paste body
<?php

/**
 * @author 
 * @copyright 2008
 */
$search = "blue";
$source = file("http://itemdb-rs.runescape.com/results.ws?query=" . $search. "&price=all&members=");
if (strpos($source, "did not return any results"))
    die("Search " . $search . " doesn't have results");
$y = 0;
for ($x = 0; $x < count($source); $x++)
{
    if (strpos($source[$x], "items matched the search term"))
    {
        $items = explode(" ", $source[$x]);
        $num = $items[1];
    }
    if (preg_match("/<img style=\"vertical\-align: middle\" src=.http:..www.runescape.com.*alt=\".*\"\stitle/",
        $source[$x]))
    {
        if (strpos($source[$x], "Members") == true)
        {
            $m[$y] = "Members";
        } else
        {
            $m[$y] = "Free";
        }
        $n[$y] = strip_tags($source[$x + 3]);
        $p[$y] = strip_tags($source[$x + 4]);
        $c[$y] = strip_tags($source[$x + 5]);
        $y++;
    }
}
print_r($n);
print_r($p);
print_r($c);
print_r($m);

?>