WebService::Gyazo::B - a Perl image upload library for gyazo.com
version 0.0405
use WebService::Gyazo::B; my $newUserId = time(); my $upAgent = WebService::Gyazo::B->new(id => $newUserId); print "Set user id [".$newUserId."]\n"; my $image = $upAgent->uploadFile('1.jpg'); unless ($upAgent->isError) { print "Image uploaded [".$image->getImageUrl()."]\n"; } else { print "Error:\n".$upAgent->error()."\n\n"; }
WebService::Gyazo::B helps you to upload images to gyazo.com (via regular expressions and LWP).
It is a fork of WebService::Gyazo by Shlomi Fish, which was done to make the deployment of some code he has written for a commission easier.
new
my $userID = time(); my $wsd = WebService::Gyazo::B->new(id => $userID);
Constructs a new WebService::Gyazo::B object. Parameter id is optional, if the parameter is not passed, it will take the value of the time() function.
WebService::Gyazo::B
setProxy
my $proxy = 'http://1.2.3.4:8080'; if ($wsd->setProxy($proxy)) { print "The proxy [$proxy] was set!"; } else { print "The proxy was not set! Error [".$wsd->error."]"; }
Set the proxy 1.2.3.4:8080 and the protocol http for the LWP::UserAgent object.
1.2.3.4:8080
LWP::UserAgent
error
print "Error [".$wsd->error."]" if ($wsd->isError);
This method return text of last error.
isError
This method return 1 if $wsd->{error} not undef, else return 0.
setId
my $newUserId = time(); if ($wsd->setId($newUserId)) { print "User id [".$newUserId."] seted!"; } else { print "User id not seted! Error [".$wsd->error."]"; }
This method set new gyazo user id.
uploadFile
my $result = $upAgent->uploadFile('1.jpg'); if (defined($result) and !$upAgent->isError) { print "Returned result[".$result->getImageUrl()."]\n"; } else { print "Error:\n".$upAgent->error()."\n\n"; }
This metod return object WebService::Gyazo::B::Image.
You can find documentation for this module with the perldoc command.
perldoc WebService::Gyazo::B
WebService::Gyazo::B::Image, LWP::UserAgent.
Modified by Shlomi Fish, 2015 (http://www.shlomifish.org/) while disclaiming all rights.
SHok, <shok at cpan.org> (http://nig.org.ua/)
Copyright 2013-2014 by SHok
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Shlomi Fish <shlomif@cpan.org>
This software is copyright (c) 2013 by SHok.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Please report any bugs or feature requests on the bugtracker website http://rt.cpan.org/NoAuth/Bugs.html?Dist=WebService-Gyazo-B or by email to bug-webservice-gyazo-b@rt.cpan.org.
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
The following websites have more information about this module, and may be of help to you. As always, in addition to those websites please use your favorite search engine to discover more resources.
MetaCPAN
A modern, open-source CPAN search engine, useful to view POD in HTML format.
http://metacpan.org/release/WebService-Gyazo-B
Search CPAN
The default CPAN search engine, useful to view POD in HTML format.
http://search.cpan.org/dist/WebService-Gyazo-B
RT: CPAN's Bug Tracker
The RT ( Request Tracker ) website is the default bug/issue tracking system for CPAN.
https://rt.cpan.org/Public/Dist/Display.html?Name=WebService-Gyazo-B
AnnoCPAN
The AnnoCPAN is a website that allows community annotations of Perl module documentation.
http://annocpan.org/dist/WebService-Gyazo-B
CPAN Ratings
The CPAN Ratings is a website that allows community ratings and reviews of Perl modules.
http://cpanratings.perl.org/d/WebService-Gyazo-B
CPAN Forum
The CPAN Forum is a web forum for discussing Perl modules.
http://cpanforum.com/dist/WebService-Gyazo-B
CPANTS
The CPANTS is a website that analyzes the Kwalitee ( code metrics ) of a distribution.
http://cpants.cpanauthors.org/dist/WebService-Gyazo-B
CPAN Testers
The CPAN Testers is a network of smokers who run automated tests on uploaded CPAN distributions.
http://www.cpantesters.org/distro/W/WebService-Gyazo-B
CPAN Testers Matrix
The CPAN Testers Matrix is a website that provides a visual overview of the test results for a distribution on various Perls/platforms.
http://matrix.cpantesters.org/?dist=WebService-Gyazo-B
CPAN Testers Dependencies
The CPAN Testers Dependencies is a website that shows a chart of the test results of all dependencies for a distribution.
http://deps.cpantesters.org/?module=WebService::Gyazo::B
Please report any bugs or feature requests by email to bug-webservice-gyazo-b at rt.cpan.org, or through the web interface at https://rt.cpan.org/Public/Bug/Report.html?Queue=WebService-Gyazo-B. You will be automatically notified of any progress on the request by the system.
bug-webservice-gyazo-b at rt.cpan.org
The code is open to the world, and available for you to hack on. Please feel free to browse it and play with it, or whatever. If you want to contribute patches, please send me a diff or prod me to pull from your repository :)
https://github.com/shlomif/WebService--Gyazo
git clone https://github.com/shlomif/WebService--Gyazo.git
To install WebService::Gyazo::B, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WebService::Gyazo::B
CPAN shell
perl -MCPAN -e shell install WebService::Gyazo::B
For more information on module installation, please visit the detailed CPAN module installation guide.