<?php
$filename = $argv[1] or die("Usage: $argv[0] filename\n");
if(!file_exists(realpath($filename))) die("Il file non esiste.\n");
$allow = array('jpg','jpeg','png','gif','bmp','tif','tiff','pdf');
if(!in_array(array_pop(explode('.',$filename)),$allow)) die("Estensione non permessa.\n");
if(preg_match('#<input type="text" onClick="track\(\'direct\'\);highlight\(this\)" style="width: 500px" size="70" value="(.+?)"/>#',`curl -F "fileupload=@$filename" -A "ImageShack Uploader" -H "Expect:" load.imageshack.us`, $out)){
print $out[1]."\n";
//system('firefox $out[1]');
} else {
print "Errore\n";
}
?>
[PHP] Imageshack uploader
Started by luruke, Feb 22 2009 11:18 AM
5 replies to this topic
#1
Posted 22 February 2009 - 11:18 AM
Small script for upload an image on imageshack using cURL
|
|
|
#2
Guest_Jordan_*
Posted 22 February 2009 - 01:18 PM
Guest_Jordan_*
Moved to the code section. Thanks for the share!
#3
Posted 22 February 2009 - 01:23 PM
Jordan said:
Moved to the code section. Thanks for the share!
thx, i'm sorry,
it will be for next time :)
#4
Guest_Jordan_*
Posted 22 February 2009 - 01:28 PM
Guest_Jordan_*
No problem. Most people miss the code section. You might want to turn these code snippets into tutorials which will earn you +rep which will get you a free shirt: http://forum.codecal...irt-thread.html and http://forum.codecal...guru-satus.html
:)
:)
#5
Posted 22 February 2009 - 01:38 PM
the t-shirt it's very awesome! i want it!
I imagine myself with this t-shirt at school! lol
I imagine myself with this t-shirt at school! lol
#6
Posted 23 February 2009 - 03:13 AM
hehe, I want to wear it to school :) Jordan, check the t-shirt thread hehe.
Simple code, but still does what is needed. There is a site that uploads to about 5 or 6 image hosting sites at once.
Simple code, but still does what is needed. There is a site that uploads to about 5 or 6 image hosting sites at once.
jQuery Selectors Tutorial - jQuery Striped Table tutorial - jQuery Events - jQuery Validation
Sorry if I don't post as often as I did, I'll try to get here as much as possible! I'm working my bum off to get this scholarship and other stuff!


Sign In
Create Account


Back to top









