Jump to content

Errors retrieving file from remote server.


absenm

Recommended Posts

I have been searching the php forums for days trying to find and answer to this issue.  Now I am going to actually ask outright and seek some direct help from everyone here.

 

I am encountering a nightmare of a problem when it comes to acquiring remote data from a website to include in the php files of my website.  My website is a Runescape fan site and Jagex, the company that makes the online game, has created a striped down version of their player high scores page so that fans can easily incorporate the data into their own sites.  The page when loaded in a browser from their site looks like this:

 

683917,1127,4423878 910344,69,726876 721075,68,615536 921816,70,774510 898926,69,695525 -1,-1,-1 1119603,44,56683 -1,-1,-1 1449695,54,152509 1984951,50,104415 1300840,37,27900 1073647,60,274972 1288527,49,93270 1150143,46,73547 973616,50,105027 782088,62,338221 519020,37,27538 525863,46,70160 617990,49,91733 591071,38,33385 441811,30,13394 -1,-1,-1 -1,-1,-1 621021,30,13433 167027,39,34321 -1,-1 -1,-1 -1,-1 -1,-1

 

It is specifically designed for easy parsing.  My problem is that I can not seem to get my php file to recognize the file address.  Jagex made the page I am requesting specifically for php retrieval so they don't have any blocks on it.  Also, the link, http://hiscore.runescape.com/index_lite.ws?player=absenm, works perfectly in a browser.  I fear that it may be the 'hiscore' subdomain that may be the issue, but I am not sure.  It seems like I can pull their home page at www.runescape.com but cannot touch the hiscore subdomain.

 

There are dozens of scripts available on the internet designed to retrieve this information page from Runescape.  Right now I am only concerned with the connectivity, not the parsing abilities.  There is no reason to work on the parsing if there is nothing to parse.  Anyway, all of the scripts I tried, and I tried everyone I could find, comes back with similar errors to those below:

 

Warning: file() [function.file]: php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/absen/public_html/hs.php on line 29

 

Warning: file(http://hiscore.runescape.com/index_lite.ws?player=Zezima) [function.file]: failed to open stream: Inappropriate ioctl for device in /home/absen/public_html/hs.php on line 29

 

Warning: CURL error: "Couldn't resolve host 'hiscore.runescape.com'" in /home/absen/public_html/RSHiLib/RSHiLib_Core/library.php on line 121

 

Here is one of the many scripts that I tried.  It is not obviously what I am going to use in the end, but it is useful for testing my connectivity.

 

<?PHP
$user="absenm";

$txt=file_get_contents('http://hiscore.runescape.com/index_lite.ws?player='.$user);
$data = explode ("\n", $txt);
$looper=0;
$skillno=0;
while ($looper<30){
$type = explode(",",$data[$looper]);
$rank[$skillno]=$type[0];
$lvl[$skillno]=$type[1];
$xp[$skillno]=$type[2];
$looper++;
$skillno++;
}
?>

 

One last note of interest.  allow_url_fopen and allow_url_include are set to (1) on.

 

If you need to see the rest of my PHP information, I have a phpinfo script at http://runethoughts.x10hosting.com/hscore.php

 

Please, any help would be greatly welcomed.  Retrieval of this data from Runescape is very important to the future design of my website.

Link to comment
Share on other sites

The following code produces the expected results on my machine:

<?php
$c = file_get_contents("http://hiscore.runescape.com/index_lite.ws?player=absenm");
echo "<pre>",print_r($c),"</pre>";
?>

 

Does something this basic return similar errors too?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.