The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

WebService::Gyazo::B - a Perl image upload library for gyazo.com

VERSION

version 0.0406

SYNOPSIS

        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";
        }

DESCRIPTION

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.

METHODS

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.

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.

error

        print "Error [".$wsd->error."]" if ($wsd->isError);

This method return text of last error.

isError

        print "Error [".$wsd->error."]" if ($wsd->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.

SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc WebService::Gyazo::B

SEE ALSO

WebService::Gyazo::B::Image, LWP::UserAgent.

AUTHOR

Modified by Shlomi Fish, 2015 (http://www.shlomifish.org/) while disclaiming all rights.

SHok, <shok at cpan.org> (http://nig.org.ua/)

COPYRIGHT

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.

AUTHOR

Shlomi Fish <shlomif@cpan.org>

COPYRIGHT AND LICENSE

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.

BUGS

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.

SUPPORT

Perldoc

You can find documentation for this module with the perldoc command.

  perldoc WebService::Gyazo::B

Websites

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.

Bugs / Feature Requests

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.

Source Code

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