WWW::Yahoo::Smushit - Perl interface to Yahoo Smushit image optimizer
my $st = new WWW::Yahoo::Smushit; if($st->upload_by_url('http://img3.imageshack.us/img3/562/synyrt2.jpg')) { printf("Image url:\t%s\nNew image:\t%s\nNew size:\t%s\nOld size:\t%s\nPercent:\t%s%%\n", $st->src, $st->dest, $st->dest_size, $st->src_size, $st->percent); } else { printf("Oops! Something is wrong...\n\nError:\t%s\n", $st->error); }
Smush.it is a service to optimize images, removing some unnecessary data.
Send a request to the Smushit via http and retrieves the JSON object.
Get the JSON and create the attributes.
Smushit.
Junior Moraes <fvox@cpan.org>
Copyright (C) 2011 by Junior Moraes
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.4 or, at your option, any later version of Perl 5 you may have available.
To install WWW::Yahoo::Smushit, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WWW::Yahoo::Smushit
CPAN shell
perl -MCPAN -e shell install WWW::Yahoo::Smushit
For more information on module installation, please visit the detailed CPAN module installation guide.