
Image::ImageShack - Upload images to be hosted at imageshack.us without needing any account information.

require Image::ImageShack; my $ishack = Image::ImageShack->new(); #you can access the LWP::UserAgent via the user_agent method #proxy can be specified by $ishack->user_agent->proxy(['http'], 'http://localhost:8080/'); my $image_url = 'http://www.domain.com/image.png'; #upload specifying a url my $url1 = $ishack->host($image_url); #upload with real size, just optimizes my $url2 = $ishack->host($image_url, 320); #resize to 320x240 (for websites and email) #upload a file my $url3 = $ishack->host('image.jpg'); #upload file #get the thumbnail address my $thumb_url = $ishack->thumb_url(); #will croak on error

Image::ImageShack intends to make programmatically possible to upload image files to the website http://imageshack.us/.
imageshack.us allows you to upload image files (jpg, jpeg, png, gif, bmp, tif, tiff, swf < 1.5 megabytes) and to optimize and or resize these files while making them available to others via imageshack.us servers (even direct linking).
A thumbnail is always created.
Constructor. Initializes the object.
Attributes are:
LWP::UserAgent object to used make HTTP requests
Boolean indicating whether thumbnails should have a black bar at the bottom with real image size
Id used to upload the files. If you have registered with imageshack.us, you should have received an email with a link similar to: http://reg.imageshack.us/setlogin.php?login=SOME_IDENTIFIER
If you intend to be able to later on use the web interface to erase files, you should pass either that link as the login parameter or only the user_id (SOME_IDENTIFIER).
No verification on the validity of the user_id is currently made
Returns or sets the LWP::UserAgent object used internally so that it can the customised
Given an url (starts with http:// or https://) or a filename and a width in pixels uploads the image to image imageshack.us and resizes it to the desired size. Returns the url of the hosted image and croaks on error.
Possible values for $size are:
Returns the url of the last uploaded image.
Returns the url of the thumbnail last uploaded image. Could be non existent for small images.
Returns or sets the user_id.
Resets user_id. From now on images won't be associated with any user.

The author declines ANY responsibility for possible infringement of ImageShack® Terms of Service.
This module doesn't use imageshack's XML API but the HTML/web interface instead.

No guarantee that this will ever be implemented
HTML code for forums, thumbnails, websites, etc (if you really need this, please ask the author)
File deletin
Implement XML API (probably never or on a different)

http://reg.imageshack.us/content.php?page=faq
http://reg.imageshack.us/content.php?page=rules

Cláudio Valente, <plank@cpan.org>

Copyright (C) 2009 by Cláudio Valente
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.