Curl and WoW-Europe.com

Miscellaneous code snippets and examples that members have posted

Curl and WoW-Europe.com

Postby Vladinator » Fri May 04, 2007 10:55 pm

Here is what I have made:

Code: Select all
$ch curl_init();
curl_setopt($chCURLOPT_RETURNTRANSFER1);
curl_setopt($chCURLOPT_URL"http://wow-europe.com/en/index.xml");
$data curl_exec($ch);
curl_close($ch);
echo 
$data;
 


I know how to make it beeing saved to a file using $data as content, but the
problem as you see is that $data contains an 500 error. I tried to make curl
get the url as Firefox, but then it showed blank.

Any ideas? :scratch:
Last edited by Vladinator on Fri May 04, 2007 10:55 pm, edited 1 time in total.
Vladinator
WR.net Apprentice
WR.net Apprentice
 
Posts: 2
Joined: Tue Jul 11, 2006 7:40 pm

Curl and WoW-Europe.com

Postby vblars » Sun May 06, 2007 5:58 am

I try this and it didn't work on their page. Maybe it is because their page is in frames.

Code: Select all


    
function vWritePageToFile$sHTMLpage$sTxtfile ) {
     
$sh =          curl_init$sHTMLpage );
     
$hFile =                       FOpen$sTxtfile'w' );
     
curl_setopt$shCURLOPT_FILE$hFile );
     
curl_setopt$shCURLOPT_HEADER);
     
curl_exec  $sh );
     
$sAverageSpeedDownload curl_getInfo$shCURLINFO_SPEED_DOWNLOAD );
     
$sAverageSpeedUpload   curl_getInfo$shCURLINFO_SPEED_UPLOAD );
     echo 
'<pre>';
     echo 
'Average speed download == ' $sAverageSpeedDownload '<br>';
     echo 
'Average Speed upload    == ' $sAverageSpeedUpload   '<br>';
     echo 
'<br>';
     
$aCURLinfo curl_getInfo$sh );
     
print_r$aCURLinfo );
     echo 
'</pre>';
     
curl_close(  $sh );
     
FClose    (  $hFile );
     echo 
'(<b>See the file  "'.$sTxtfile.'"  in the same path of the hosting'.
          
' to where this script PHP</b>).<br>';
    }

    
vWritePageToFile'http://www.wow-europe.com/en/index.xml''blizzard.txt' );

?>

Last edited by vblars on Sun May 06, 2007 5:59 am, edited 2 times in total.
User avatar
vblars
WR.net Apprentice
WR.net Apprentice
 
Posts: 50
Joined: Tue Jul 04, 2006 1:52 pm


Return to Code Cache

Who is online

Users browsing this forum: No registered users and 0 guests

cron