Remote Upload To Imageshack.Us With PHP+cURL
Advertisement
PHP supports libcurl since V 4.0.2, a library created by Daniel Stenberg (more information go here), that allows you to connect and communicate to many different types of servers with many different types of protocols. libcurl currently supports the http, https, ftp, gopher, telnet, dict, file, and ldap protocols. libcurl also supports HTTPS certificates, HTTP POST, HTTP PUT, FTP uploading (this can also be done with PHP’s ftp extension), HTTP form based upload, proxies, cookies, and user+password authentication.
Now with cURL we trying to make a script that post images to Imageshack.Us via remote upload and return direct link of images. Here the source code to download.
Update Scipt! Please download new version – 20 December 2009.
Pass : smileylover.com
This script should work and return direct link of images that being upload. If the result is empty (error with cURL) it will return Something went wrong with Imageshack?, but if result is empty for preg_match_all function it will return Imageshack.Us Remote Upload Failed Because They Change Layout Again! and send email to your email. Just announcement.
Usually, there’s an error with preg_match_all because Imageshack.Us is change their HTML tag regularly (i think) to avoid script like this (Hey with this script same with block their ads :p ). If an error occurs just come back to here to get update with working script.
Regards.
nb: i prefer imageshack.us because they have a lot of bandwith. they allow us to use their bandwith 300MB/hour per single image!
Related posts:


hi, cant we get a simple image upload script with using this code without writing any url-img.
like in tinypic or imageshack mainpage, but the site automaticly upload pic to imageshack like in this code…
That server uses for this script in the demo?
Is it a free?
What is it?
I already tried with 000webhost.com and freehostia and I can“t make it work.
any help?
Curl is enabled on my server.
no i use paid server
anyway .. 000 is work
for all … plesae update this script with this changes ….
find similiar code like above and replace with that ones
and this one …
regards.
nothing works, even updates with php syntax errors…
rel=”nofollow” – > rel=\”nofollow\”
@ric
sorry .. it’s seems like WP reformat my code ….. please remove rel=”nofollow” extra in last code …
regards
you can see it working in http://imageremoter.co.nr
Hey i did like this
<?php
$rwimg = explode(“[IMG]“,$result);
$rw1 = explode(“[/IMG]“,$rwimg[1]);
$viewimg = $rw1[0];
echo “”;
?>
No ways to escape the value even any change in layout!
$rwimg = explode(“[IMG]“,$result);
$rw1 = explode(“[/IMG]“,$rwimg[1]);
$viewimg = $rw1[0];
echo $viewimg;
Thnx for suggestion
may i see ur full code?
regards
Hi admin can you implement new api based system
post link
[code]http://www.imageshack.us/upload_api.php?url=http://imageshack.us/images/greylogo.png[/code]
???
http://reg.imageshack.us/content.php?page=developer
sure i cant
just parse xml to php …. but i need more times .. .bcoz i have a job that must to finished right now..
regards …
Hi, can you write me your server config please? I try your script on 3 servers but it doenst work
cURL is working, but upload file with cURL isnt working. Thank you
i use standard config
btw whats the warning?
regards
Warning: Warning! Image type not valid or supported.
I try the some image – on your demo is it working. But on my website not.
I really dont know where is fault. I wrote my own app and I am using binary curl through exec and it is working.
sorry …..
u can change the code to be like this … find the smiliar code
regards
I’ve tried replacing the code with that, but now there is no link to the hosted image, only the original image url.
soons, i’ll upload a full code here
regards
Warning! Image type not valid or supported.