Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as PHP by HMJ ( 13 years ago )
<?php
    $url= 'http://us.battle.net/wow/pt/status#type=pvp&locale=brasil&name=Azralon';
 //<div class="status-icon down" data-tooltip="Offline"></div>

 //unique text to determine start goes here
 $start = "class=\"status-icon";
 //insert end text here
 $end = "Azralon";
 $ch = curl_init();
 curl_setopt ($ch, CURLOPT_URL, $url );
 curl_setopt ($ch, CURLOPT_HEADER, 0);
 curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
 $result = curl_exec &#40;$ch&#41; or die ("Couldn't connect to $url.");
 curl_close ($ch);
 $startposition = strpos($result,$start);
 if($startposition > 0){ 
   $endposition = strpos($result,$end, $startposition);
   //add enough chars to include the tag
   $endposition += strlen($end);
   $length = $endposition-$startposition;
   $result_name = substr($result,$startposition,$length);
   echo $result_name;
 }else
   echo "<center><h3>Not found - try again later.</h3></center>";
?>

 

Revise this Paste

Your Name: Code Language: