@ 2014-09-07T22:00:03Z <?php
$url="http://www.mobiflip.de/xperia-play-china-geraete-konzept/";
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_TIMEOUT, 3);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HEADER, false);
// FeedBurner requires a proper USER-AGENT...
curl_setopt($curl, CURL_HTTP_VERSION_1_1, true);
curl_setopt($curl, CURLOPT_ENCODING, "gzip, deflate");
curl_setopt($curl, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3");
$content = curl_exec($curl);
$content = substr($content,strpos($content,"<body>"));
// $content = substr($content,strpos($content,$n->title));
//echo $content;
preg_match_all('@src=[\'"](?:http(?:s)*:)*(?://)*(?P<src>[a-zA-Z0-9/_\-\.]+(jpg|png|gif|jpeg|tif))[\'"\?%]@i', $content, $image);
//$c = new DOMDocument();
//@$c->loadXML($content);
//var_dump($c->getElementsByTagName('img'));//->item(0)->getAttribute('src');
//$xml=simplexml_load_string($content);
//print_r($xml);
//return;
$actPic = new stdClass();
$actPic->size=0;
$actPic->url=null;
foreach($image['src'] as $pic){
try{
$pic="http://".$pic;
$sz=getimagesize($pic);
echo "<br>".$pic.":";var_dump($sz);echo "<br>";
if( $sz && $sz[0]>400 && $sz[0]*$sz[1] > $actPic->size ){
$actPic->size=$sz[0]*$sz[1];
$actPic->url=$pic;
}
}catch(Exception $e){
Debugbar::addError($e);
}
}
echo "<img src='".$actPic->url."'><br>";
?>
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Output for 7.0.0 - 7.0.33 , 7.1.0 - 7.1.33 , 7.2.0 - 7.2.33 , 7.3.0 - 7.3.33 , 7.4.0 - 7.4.33 , 8.0.0 - 8.0.30 , 8.1.0 - 8.1.28 , 8.2.0 - 8.2.18 , 8.3.0 - 8.3.6 Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/KJafT:6
Stack trace:
#0 {main}
thrown in /in/KJafT on line 6
Process exited with code 255 . Output for 5.0.0 - 5.0.5 , 5.1.0 - 5.1.6 , 5.2.0 - 5.2.17 , 5.3.0 - 5.3.29 , 5.4.0 - 5.4.45 , 5.5.0 - 5.5.38 , 5.6.0 - 5.6.40 Fatal error: Call to undefined function curl_init() in /in/KJafT on line 6
Process exited with code 255 . Output for 4.4.2 - 4.4.9 Parse error: syntax error, unexpected '{' in /in/KJafT on line 42
Process exited with code 255 . Output for 4.3.0 - 4.3.1 , 4.3.5 - 4.3.11 , 4.4.0 - 4.4.1 Parse error: parse error, unexpected '{' in /in/KJafT on line 42
Process exited with code 255 . Output for 4.3.2 - 4.3.4 Parse error: parse error in /in/KJafT on line 42
Process exited with code 255 . preferences:dark mode live preview
265.96 ms | 401 KiB | 459 Q