Danjen Posted August 24, 2009 Share Posted August 24, 2009 I have a question about the way Tip.It gets its item prices. For example, Iron Ore. The values listed here on Tip.It match perfectly with the GE stuff listed on Runescape's main site; as of this writing, 121g a piece. So, my question is: How does Tip.It load the data from Runescape's highscore and GE servers? Link to comment Share on other sites More sharing options...
Poppet Posted August 24, 2009 Share Posted August 24, 2009 I have a question about the way Tip.It gets its item prices. For example, Iron Ore. The values listed here on Tip.It match perfectly with the GE stuff listed on Runescape's main site; as of this writing, 121g a piece. So, my question is: How does Tip.It load the data from Runescape's highscore and GE servers? I believe things like google documents can do it etc. Link to comment Share on other sites More sharing options...
Laura Posted August 24, 2009 Share Posted August 24, 2009 Your question will be better answered in Help and Advice. Link to comment Share on other sites More sharing options...
Danjen Posted August 24, 2009 Author Share Posted August 24, 2009 Oops, didn't even notice that forum. :wall: Feel free to move/delete/close this. Link to comment Share on other sites More sharing options...
Laura Posted August 24, 2009 Share Posted August 24, 2009 All is well. :) Link to comment Share on other sites More sharing options...
MPM Posted August 24, 2009 Share Posted August 24, 2009 It's a 3 step process. 1: Connect our item id to the GE id. This is pretty much just searching the ge for the item we want and entering the number elsewhere. 2: Use the curl library to get the GE page. That gets the exact same thing you get if you go to it. 3: Parse out the useful information and save it. ~M Link to comment Share on other sites More sharing options...
Danjen Posted August 24, 2009 Author Share Posted August 24, 2009 That simple, huh? Well, I'm sure it's a lot more involved than that, but it's a good point in the right direction. Thanks for the help, then. :) Link to comment Share on other sites More sharing options...
detoid9 Posted August 24, 2009 Share Posted August 24, 2009 It's a 3 step process. 1: Connect our item id to the GE id. This is pretty much just searching the ge for the item we want and entering the number elsewhere. 2: Use the curl library to get the GE page. That gets the exact same thing you get if you go to it. 3: Parse out the useful information and save it. A basic example in PHP would be: <?php $ch = curl_init(); curl_setopt( $ch, CURLOPT_HEADER, 0 ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch, CURLOPT_URL, "url_to_item_page" ); $text = curl_exec( $ch ); // $text now contains the webpage source from the specified URI, so we can parse it using preg_match() etc. // This just so happens to be code I use in my G.E. Crawler if ( preg_match( '/Market price:<\/b>\\s([,.km\\d]+)/i', $text, $match ) ) $ge_market_price = $match[1]; else $ge_market_price = null; // Will put the market price to the page. To make it a pure integer you still need to convert values like 120.5k to 120500 etc echo $ge_market_price; curl_close( $ch ); ?> If you were to be crawling the entire G.E. database then I would highly recommend using multi-threaded cURL, to greatly reduce latency and speed. You have already contacted me about my PHP Crawler code which uses this method. Pure Account: Mrs Destiney -> 82 Attack, 83 Strength, 12 Defence Tank Account: Cyez In Lumb -> 70 Range, 64 Defence. Goals: 85 Range, 85 Defence Link to comment Share on other sites More sharing options...
Danjen Posted August 24, 2009 Author Share Posted August 24, 2009 It's a 3 step process. 1: Connect our item id to the GE id. This is pretty much just searching the ge for the item we want and entering the number elsewhere. 2: Use the curl library to get the GE page. That gets the exact same thing you get if you go to it. 3: Parse out the useful information and save it. A basic example in PHP would be: *snip* If you were to be crawling the entire G.E. database then I would highly recommend using multi-threaded cURL, to greatly reduce latency and speed. You have already contacted me about my PHP Crawler code which uses this method.Yes, that is correct. And that PHP code should be a great help on how to work with cURL. :) 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