Adblock breaks this site

[PHP] Runescape Total Players Grabber Source :)

Discussion in 'Web Programming' started by SidStudios, Feb 9, 2008.

  1. SidStudios

    SidStudios Active Member

    Joined:
    Mar 14, 2007
    Posts:
    201
    Referrals:
    0
    Sythe Gold:
    0
    [PHP] Runescape Total Players Grabber Source :)

    I've just created a pretty nice script which extracts the total number of players in Runescape, using the cURL, explode, and replace functions.

    You can find it at http://hacktalk.org/forums/index.php?topic=12.0
    I've tried posting the source, but as cp_ stated, it is impossible to post raw PHP; it keeps giving me some error about newthread.php not being able to be found.

    Anyways, you don't need to log in to view it, so I see no harm in it. If you feel like supporting me, please join :)

    If you have any improvements, please post them there as I will not be monitoring this thread as often.

    Thanks,

    Sid
     
  2. cp

    cp an cat
    Banned

    Joined:
    Jan 30, 2007
    Posts:
    3,278
    Referrals:
    6
    Sythe Gold:
    0
    [PHP] Runescape Total Players Grabber Source :)

    Hm, was cURL really necessary? I believe file_get_contents() would work, saving just a few lines a some system resources...
     
  3. Rdogg999

    Rdogg999 Active Member

    Joined:
    Jan 16, 2008
    Posts:
    215
    Referrals:
    0
    Sythe Gold:
    0
    [PHP] Runescape Total Players Grabber Source :)

    Is doesnt work for me :/
     
  4. cp

    cp an cat
    Banned

    Joined:
    Jan 30, 2007
    Posts:
    3,278
    Referrals:
    6
    Sythe Gold:
    0
    [PHP] Runescape Total Players Grabber Source :)

    Are you saving it as an html file? Or even a php file? The problem could be that you may not have PHP installed. Try looking into a host with it on. Also, if you have confirmed that you indeed are running the script on a server with PHP, check then if you have cURL enabled. Lots of free hosts have it disabled, and it may not work for you. Also, if there are any errors, it would be easier for anyone to help you.
     
  5. SidStudios

    SidStudios Active Member

    Joined:
    Mar 14, 2007
    Posts:
    201
    Referrals:
    0
    Sythe Gold:
    0
    [PHP] Runescape Total Players Grabber Source :)

    Hmm, I tried Readfile and fread, but I didn't know about File_get_contents. I'll try that out, thanks.
     
  6. cp

    cp an cat
    Banned

    Joined:
    Jan 30, 2007
    Posts:
    3,278
    Referrals:
    6
    Sythe Gold:
    0
    [PHP] Runescape Total Players Grabber Source :)

    Hm, I guess that didn't work. File_get_contents(); kept timing out on me >_<
     
  7. night

    night Member
    Banned

    Joined:
    Apr 21, 2005
    Posts:
    60
    Referrals:
    1
    Sythe Gold:
    5
    [PHP] Runescape Total Players Grabber Source :)

    fyi, curl is quite a bit faster than file_get_content().
     
  8. cp

    cp an cat
    Banned

    Joined:
    Jan 30, 2007
    Posts:
    3,278
    Referrals:
    6
    Sythe Gold:
    0
    [PHP] Runescape Total Players Grabber Source :)

    Fyi, file_get_contents() is faster. Curl goes through a longer process to get the page. I suppose someone should actually try testing the times, but I'm sort of lazy...
     
  9. SidStudios

    SidStudios Active Member

    Joined:
    Mar 14, 2007
    Posts:
    201
    Referrals:
    0
    Sythe Gold:
    0
    [PHP] Runescape Total Players Grabber Source :)

    Also, cURL can be used to do a LOT more thngs than file_get_contents, but obviously this is not a scenario where we can use it.
    It's amazing how much it can do; referrer spoofing, etc :)
     
< Making Whole New Forums! Where I Begin? | Very basic Pascal >


 
 
Adblock breaks this site