Here, one of the responses (#3) tells:
http://deviantsart.com has a public and easy to use API just HTTP POST the image to their domain and you will get a JSON with the URL
Here is the URL:
Are there any image hosting services with a public API?
The only instructions are basically
"Upload using our public REST API: POST http://deviantsart.com yourimage.jpg
JSON-Result:
{ "url" : "urltoimage" }"
Nice, but, how can I make it programmable?
Here is my code:
//the file was uploaded by a simple html form
if ($_POST) { //submit
$tmp = array_merge($_POST);
$r = new HttpRequest('http://deviantsart.com', HttpRequest::METH_POST);
$r->addPostFile($tmp['img']); //tmp has post vars
echo $r->getUrl();
try {
echo $r->send()->getBody();
exit();
} catch (HttpException $ex) {
echo $ex;
exit();
}
}
LAST EDIT: please, dont care about my code, try to solve with your own. I just want see how it works. Many thanks!