...

View Full Version : pulling data from one website to display on another



stevex33
02-26-2007, 03:06 PM
Hi,
I'm a pretty big noob when it comes to php development, this might even be asp, I'm not sure, so forgive me if this is the wrong place for this.

There is an online game called runescape and you can gain experience in skills by doing certain things.

Basically I would like to create a calculator to tell someone how far they have left until they level up.

Here's an example of one that my competitor is using:
http://www.tip.it/runescape/?page=mining_calc.htm

You type in your character name and click get stats.
Doing this pulls your character data from the official high scores list of the game:
http://hiscore.runescape.com/lang/en/aff/runescape/hiscores.ws

The calculator asks you to type in what level you want to get to, and it then calculates how many times you have to do a given task to level up to that level.

Some tasks give more experience than others.

If I know how much experiene each task gives per attempt, how can I make a calculator like this.

Sorry if that's a lot to ask, especially for my first post.

I look forward to your advice.

aedrin
02-26-2007, 03:14 PM
You'd have to write a PHP script that will get the data from the Search By Name feature. If you look at the source, it's a POST request to hiscorepersonal.ws, with a parameter of name1 being the user's name.

You can get this data for instance by using PEAR's HTTP_Request.

Next, you will have to find some sort of pattern, and extract the information out of the HTML that is returned. This can be done by regular expressions, DOM methods or plainly searching the string.

stevex33
02-26-2007, 03:20 PM
Hi,
thanks for your reply.
This might sound very stupid, but what is "PEAR's HTTP_Request" and where can I get it?

"Next, you will have to find some sort of pattern, and extract the information out of the HTML that is returned. This can be done by regular expressions, DOM methods or plainly searching the string."

Type in stevex33 into the box to give you a better idea of how it works if you think it would help understand it better.(It's my character name I use in the game).

How can I extract the information out of the html that is returned, I don't know what dom or regular expressions are sorry :(

I could search the string (If you mean manually) but I would need it to be automatic so that the users of my website could use it at will.

For the specific calculator page that I pointed out, all that the script pulls from the high scores is the users mining level and mining experience level, as far as I'm aware, the rest of the data is ignored.

Then I'm assuming that when the script finds to experience level it calculates how many times you would have to do a task, such as mining iron, to get to the level you specified.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum