lulzimg

Status
Not open for further replies.

ciaociao4

Active Member
396
2011
26
0
hello

i use lulzimg for host my picture :D


i use a script for this and works for some image and not for other...

i don't know why...


my script....

$img=postHost("http://www.lulzimg.com/upload.php?submit=lulz&url=$shot", "", "");
preg_match_all("/\[IMG\]http:\/\/[a-z0-9.]+\/[a-z0-9A-Z.]+/", $img, $matches);
$imageUrl = $matches[0][0];
$screenshot = str_replace('','',$imageUrl);


this work for some img and not for other....

work with this : [url]http://i25.lulzimg.com/ace7c2.jpg[/url]
and not work with this : [url]http://i25.lulzimg.com/c7d6d0.jpg[/url]

(work with other xxx image)

i dont know the difference :(
 
5 comments
i use mtn

the problem is that the script work for some image and not for other

(in the example ...the second i upload manualy)


i see it work if the image it's from a avi...aa nfo etc..etc..

and not work if it's from mp4 or wmv

but i dont know why :(

(if i upload manualy all the image work)
 
try this, i've made it months before for a custom script and it should work
PHP:
function lulzit($link) {
	$a = 0;
	do {
		$res = postit("http://www.lulzimg.com/upload.php?submit=lulz&url=" . $link, "", true);
		preg_match("/\[IMG\](.*?)\[\/IMG\]/i", $res, $matches);
		$a++;
	}while((($matches == false) or (!isset($matches[1]))) and ($a<5));
	return $matches[1];
}

and postit() function
PHP:
function postit($url, $postdata, $header = false, $cookie = "", $follow = 0) {
	$ch = curl_init();
      	curl_setopt($ch, CURLOPT_URL, $url);
      	curl_setopt($ch, CURLOPT_COOKIESESSION, 1);
      	if($header == true) {
      		curl_setopt($ch, CURLOPT_HEADER, 1); 
      	}
      	if($cookie <> "") {
      		curl_setopt($ch, CURLOPT_COOKIE, $cookie); 
      	}
      	if($follow <> 0) {
      		curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); 
      	}
      	if($postdata <> "")	{
      		curl_setopt($ch, CURLOPT_POST, 1); 
      		curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata); 
      	}
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 60);
	curl_setopt($ch, CURLOPT_TIMEOUT, 60);
	curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));
	curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.2) Gecko/20100115 Firefox/3.6 (.NET CLR 3.5.30729)");
    $source_code = curl_exec($ch);
    curl_close($ch);
    return $source_code;
}
 
Status
Not open for further replies.
Back
Top