Mercifull Posted April 16, 2009 Share Posted April 16, 2009 Does anyone have some code (or if somone else has done it, a link) to simply lookup the market price of an item on the Grand exchange in the following format: www.blah.com/ge.php?id=100 and it just returns the figure. Cheers. Do not want anything fancy. Mercifull <3 Suzi "We don't want players to be able to buy their way to success in RuneScape. If we let players start doing this, it devalues RuneScape for others. We feel your status in real-life shouldn't affect your ability to be successful in RuneScape" Jagex 01/04/01 - 02/03/12 Link to comment Share on other sites More sharing options...
Mercifull Posted April 16, 2009 Author Share Posted April 16, 2009 <?php $id = $_GET['obj']; $url = "http://itemdb-rs.runescape.com/viewitem.ws?obj=".$id; function rs_getprices($url) { $price = array(); $fh = fopen($url, "rb"); while (!feof($fh)) { $line = fgets($fh); if(!$min) sscanf($line, "Minimum price: %s", $min); else if(!$mar) sscanf($line, "Market price: %s", $mar); else if(!$max) sscanf($line, "Maximum price: %s", $max); else break; } fclose($fh); $price['minimum'] = $min; $price['market'] = $mar; $price['maximum'] = $max; return $price; } $item = rs_getprices($url); ?> <?php echo $item['market']; ?> that works but its not sanitised and anyone can put obj=blahblah.com at the end instead of only allowing numbers. Could someone here help me make it so it will only accept numbers and display error messages accordingly etc.? Mercifull <3 Suzi "We don't want players to be able to buy their way to success in RuneScape. If we let players start doing this, it devalues RuneScape for others. We feel your status in real-life shouldn't affect your ability to be successful in RuneScape" Jagex 01/04/01 - 02/03/12 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now