teuneboon Posted August 29, 2008 Share Posted August 29, 2008 I made a simple php script that uses curl to get the price of a ge item of the runescape site. Just place it on top of a .php file, and then you can call it by using: echo getprice(itemid); You can find the id of an item if you look at it in runescape grand exchange. Like for grain: http://teun.beijers.eu (making it english soon). <?php function getprice($id) { $url = "http://itemdb-rs.runescape.com/viewitem.ws?obj=".$id; $startat = "Market price: "; $stopat = ""; $ch = curl_init(); $timeout = 5; curl_setopt ($ch, CURLOPT_URL, $url); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout); $start = curl_exec($ch); curl_close($ch); $exploded = explode($startat,$start); $exploded = explode($stopat,$exploded[1]); $result = str_replace(' ','',nl2br($exploded[0])); return $result; } echo getprice(1947);//get grain price ?> Link to comment Share on other sites More sharing options...
Owned_Nex Posted August 30, 2008 Share Posted August 30, 2008 Very nice... But I don't see how you get the item ID? Dungeoneering isn't a skill. I'm faster than bots at Sorceress Garden. PM me if you want to chat. My PM is always off. My keyboard is on fire. Want some? Link to comment Share on other sites More sharing options...
teuneboon Posted August 30, 2008 Author Share Posted August 30, 2008 You know how to access all grand exchange prices on the runescape main site? Just click on an item there, and in the adress bar there should be a number at the end of the url, this is the id. Link to comment Share on other sites More sharing options...
HoMM88 Posted August 30, 2008 Share Posted August 30, 2008 OMFG THIS IS SO AWESOME. I <3 U. lol. My goals: [b]5M coins:[/b] 4350K+ coins 200k+ items - 2 dec 5M coins - 16 dec I [b]have gotten[/b] my 5M by christmas. -bah this is only here for historical purposes now, I got 20m+ already "fail,well atleast the title,i wont read it with that colours""If you hadn't posted in rainbow I would actually give this a proper read""Colours suck."*I remove colours*"Where did all the colors go!? This is now 40% more likely to be tl;dr'd due to the lack of colors." Link to comment Share on other sites More sharing options...
teuneboon Posted August 31, 2008 Author Share Posted August 31, 2008 @Homm: in one word: lol Link to comment Share on other sites More sharing options...
Deathmath Posted August 31, 2008 Share Posted August 31, 2008 This has MANY applications. There are lready scripts but it's not bad in of itself. Thoroughly retired, may still write now and again Link to comment Share on other sites More sharing options...
la la la Posted August 31, 2008 Share Posted August 31, 2008 Now is there a way to write a script that simply alerts you when the prices update? That would sure make 3a buying easier. Link to comment Share on other sites More sharing options...
HoMM88 Posted August 31, 2008 Share Posted August 31, 2008 Now is there a way to write a script that simply alerts you when the prices update? That would sure make 3a buying easier. Gl with that, GE website updates like 10 minutes after the prices actually update, I already have such a trick that alerts me when the website updates. And btw I was serious. This is awesome. I am so gonna learn some PHP to make myself a price tracker/calculator (for personal merchanting use) but school is coming so I dont have much time... :/ My goals: [b]5M coins:[/b] 4350K+ coins 200k+ items - 2 dec 5M coins - 16 dec I [b]have gotten[/b] my 5M by christmas. -bah this is only here for historical purposes now, I got 20m+ already "fail,well atleast the title,i wont read it with that colours""If you hadn't posted in rainbow I would actually give this a proper read""Colours suck."*I remove colours*"Where did all the colors go!? This is now 40% more likely to be tl;dr'd due to the lack of colors." Link to comment Share on other sites More sharing options...
teuneboon Posted September 2, 2008 Author Share Posted September 2, 2008 I recommend you to go to the library and get a basic book then, and find a nice online community where you can ask stuff(phphulp.nl, dutch site for me) 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