Reply
 
Thread Tools Display Modes
Old 10th Dec 2011, 10:55 AM   #1
It begins...
 
Lightbulb LulzImg API (sort of) Upload Example

I suppose this has already been posted somewhere, but I figured I'd post it once and for all. Good for people who're looking for it, and because ciaociao4 and Blaze wanted an example.

LulzImg's app.php is a very simple API-ish type script (lol) which I coded a few months back for private use. Eventually, I gave it out on a selective basis to people who needed it.

It accepts an image, a zip, or a rar file. If it encounters a zip/rar file, it'll extract it, and copy any images found in it. It'll dump everything else inside; dumping happens during run-time so don't bother trying to inject malicious files/code.

You basically need to make your script simulate this form:
Code:
		<form enctype="multipart/form-data" action="http://lulzimg.com/app.php" method="POST">
		<input type="file" name="image" id="image" />
		<br />
		<input type="submit" name="submit" value="submit"></button>
		</form>
A php example:
PHP Code:
<?php

function curl($link$postfields '')
{
    
$ch curl_init($link);
    
curl_setopt($chCURLOPT_RETURNTRANSFER1);
    
curl_setopt($chCURLOPT_HEADER0);
    
curl_setopt($chCURLOPT_FOLLOWLOCATION0);
    
curl_setopt($chCURLOPT_USERAGENT'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1');
    if(
$postfields)
    {
        
curl_setopt($chCURLOPT_POST1);
        
curl_setopt($chCURLOPT_POSTFIELDS$postfields);
    }
    
$page curl_exec($ch);
    
curl_close($ch);
    return(
$page);
}

$img "C:\Program Files\VertrigoServ\www\img.jpg"//Or linux path
$post = array();
$post['image'] = "@$img";
$post['submit'] = "submit";
$page curl("http://lulzimg.com/app.php"$post);
echo 
$page;

?>
Return/output is the resulting links, each on a new line. I don't remember if it's separated by a "\n" or a "<br />" but you can look up the source code and do a regex match accordingly.
Lifetalk is offline   Reply With Quote
Liked by:
Apathetic (6th Jan 2012), BlaZe (10th Dec 2011), GoDofAdeN (16th Dec 2011)
Old 10th Dec 2011, 10:56 AM   #2
Too busy :|
 
BlaZe's Avatar
 
Website(s):
L337Fx.com HelpDonate.co
Default

Ah ! Thanks just what I needed ! perfect
EDIT:
Shows me a blank screen.

I tried to change the $img = "http://domain.com/path/to/image.png";

It gave me a blank screen with and without the change

Last edited by BlaZe; 10th Dec 2011 at 11:06 AM.
BlaZe is offline   Reply With Quote
Old 10th Dec 2011, 11:18 AM   #3
Respected Member
 
soft2050's Avatar
 
Website(s):
DL4Everything.com Soft2050.in
Send a message via Yahoo to soft2050
Default

The above api is only for image uploading (local file)

For remote upload, try:

PHP Code:
<?php
function lulzremote($url) {
$source file_get_contents("http://lulzimg.com/upload.php?submit=lulz&url=$url");
preg_match('/\[IMG\](.*)\[\/IMG\]/'$source$match);
return 
$match[1];
}

$url 'http://ads.wjunction.com/ads/659.gif';
echo 
lulzremote($url);
?>
soft2050 is offline   Reply With Quote
Old 10th Dec 2011, 12:45 PM   #4
Too busy :|
 
BlaZe's Avatar
 
Website(s):
L337Fx.com HelpDonate.co
Default

I already use an existing code by automan & mRAza for uploading to lulzimg.com

I thought to make use of the API as it'd be definitely fast

http://www.l337fx.com/lulzimgcom-ima...oader-php.html
Demo: http://www.l337fx.com/tools/imgul/lulz.php
BlaZe is offline   Reply With Quote
Old 10th Dec 2011, 01:59 PM   #5
Member
 
Website(s):
fileservedownload.net
Default

thanks
ciaociao4 is offline   Reply
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sort Thread By... itsHERO vBulletin 1 20th Oct 2011 05:47 PM
[REQ]lulzimg upload with php jokerhacker Development Area 26 25th Apr 2011 03:49 PM
How to create some sort of database? (Not SQL or something) Dark-BlaZe vBulletin 2 21st Jul 2010 08:02 PM
[phpBB2] How to sort this? pi0tr3k phpBB 8 2nd Apr 2010 03:24 PM

All times are GMT. The time now is 02:15 AM.