Jump to content

Loading GE Prices?


Danjen

Recommended Posts

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

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

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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.