Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Feb 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    pulling data from one website to display on another

    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...pe/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.

  • #2
    Senior Coder
    Join Date
    Jan 2007
    Posts
    1,648
    Thanks
    1
    Thanked 58 Times in 54 Posts
    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.

  • #3
    New to the CF scene
    Join Date
    Feb 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •