Adblock breaks this site

[PHP] Dynamic Signature Help

Discussion in 'Web Programming' started by RuneOwn, Apr 5, 2007.

  1. RuneOwn

    RuneOwn Guest

    Referrals:
    0
    [PHP] Dynamic Signature Help

    Okay, ive been trying to make some dynamic signatures for runescape. Ive been using google and ive learnt how to make dynamic signatures. The only thing is i dont have a clue of how to get the data from the runescape highscores. A bit of a nudge in the correct direction would be great. Thanks

    ~RuneOwn
     
  2. cp

    cp an cat
    Banned

    Joined:
    Jan 30, 2007
    Posts:
    3,278
    Referrals:
    6
    Sythe Gold:
    0
    [PHP] Dynamic Signature Help

    Learn sockets and open the webpage, use either regex or split the page into parts and there you have your information.
     
  3. night

    night Member
    Banned

    Joined:
    Apr 21, 2005
    Posts:
    60
    Referrals:
    1
    Sythe Gold:
    5
    [PHP] Dynamic Signature Help

    Well I dont know, if you still need this, but:

    You first need to check if allow_url_fopen is enabled (it needs to be)

    next you can use the fopen() function to open a url so something like
    Code:
    $stats = fopen("http://hiscore.runescape.com/hiscorepersonal.ws?user1="$username, r);
    $stats2 = strip_tags($stats); 
    this strips the html/php tags the site may use. So now all you have is a bunch of text like Attack 15 Defense 25... blah blah
    then you can split it into an array using str_split($stats2); and then look at the stats you want through the array...

    you should probaby close the file too to save memory.... Hope this nudge helps, you can aim me if you need help.
     
  4. MellowYellow

    MellowYellow Guest

    Referrals:
    0
    [PHP] Dynamic Signature Help

    What I personally would do is use regex. It'll give you more control than using a split. You can also use file_get_contents() to grab the source. I also replace the newlines in the source.

    In case you don't feel like taking on regex - which only looks difficult, but is easy - this is the search string I use for the highscores:
    /.*($skill)<\/a><\/td><td align=\"right\">([0-9,]*)<\/td><td align=\"right\">([0-9]*)<\/td><td align=\"right\">([0-9,]*).*/i

    In conjunction with preg_replace, $1 is the skill, $2 is your rank, $3 is your level, and $4 is your exp.

    Here is an example for you:
    http://script-dump.freehostia.com/data.php?user=zezima
     
  5. Artsrun1990

    Artsrun1990 Active Member

    Joined:
    Jan 21, 2007
    Posts:
    191
    Referrals:
    0
    Sythe Gold:
    0
    [PHP] Dynamic Signature Help

    hey i tired that and it didnt work can u help me?
     
  6. Jazz00006

    Jazz00006 Apprentice
    Visual Basic Programmers

    Joined:
    Aug 26, 2005
    Posts:
    807
    Referrals:
    0
    Sythe Gold:
    0
    [PHP] Dynamic Signature Help

    how many times to i have to post this?
    http://jazz.cruels.net/ > PHP > Dynamic sig pack

    all you will ever need is in there
     
  7. Repentless

    Repentless Apprentice
    Banned

    Joined:
    May 11, 2006
    Posts:
    669
    Referrals:
    3
    Sythe Gold:
    0
    [PHP] Dynamic Signature Help

    Blank when I go there :p
     
< [PHP/HTML] Form Actions. Need help! | Need a auction script. [PHP or Perl] >


 
 
Adblock breaks this site