WWW::Pocket - Wrapper for the Pocket v3 API
version 0.03
use WWW::Pocket; my $pocket = WWW::Pocket->new( # get a consumer key at https://getpocket.com/developer/ consumer_key => '...', ); my ($url, $code) = $pocket->start_authentication('https://example.com/'); # visit $url, log in $pocket->finish_authentication($code); say for map { $_->{resolved_url} } values %{ $pocket->retrieve->{list} };
This module wraps the Pocket v3 API. To use, you must first authenticate via OAuth by providing a valid consumer key, and then visiting the OAuth endpoint (handled by the start_authentication and finish_authentication methods). Once logged in, you can interact with the API via the add, modify, and retrieve methods, which correspond to the endpoints documented at https://getpocket.com/developer/docs/overview.
start_authentication
finish_authentication
add
modify
retrieve
This module also ships with a command line scripts called pocket, for interacting with the API from the command line. See the documentation for that script for more details.
pocket
The consumer key for your application. You can generate a consumer key at https://getpocket.com/developer/apps/. Required.
The token returned when you successfully authenticate. This can be used to reauthenticate with the server without having to log in every time. It is set automatically by finish_authentication, but can also be provided directly to avoid having to reauthenticate. It is required to be set before any API methods are called.
The username that you have authenticated as. It is set automatically by finish_authentication, and can also be provided directly. It is informational only.
The base URI for the Pocket service. Defaults to https://getpocket.com/.
https://getpocket.com/
The base URI for the API endpoints. Defaults to appending /v3/ to the base_uri.
/v3/
base_uri
The base URI for the authentication endpoints. Defaults to appending /auth/ to the base_uri.
/auth/
The HTTP::Tiny instance used to access the api.
Call this method to begin the authentication process. You must provide the $redirect_uri, which is where the user will be redirected to after authenticating. This method returns a URL and an authentication code. The user must visit the URL to log into Pocket and approve the application, and then you should call finish_authentication with the authentication code after that is done.
$redirect_uri
Finishes the authentication process. Call this method with the code returned by start_authentication after the user has visited the URL which was also returned by start_authentication. Once this method returns, the access_key and username attributes will be set, and other API methods can be successfully called.
access_key
username
Wraps the add endpoint. %params can include any parameters documented in the API documentation.
%params
Wraps the modify endpoint. %params can include any parameters documented in the API documentation.
Wraps the retrieve endpoint. %params can include any parameters documented in the API documentation.
No known bugs.
Please report any bugs to GitHub Issues at https://github.com/doy/www-pocket/issues.
Webservice::Pocket for the v2 API
You can find this documentation for this module with the perldoc command.
perldoc WWW::Pocket
You can also look for information at:
MetaCPAN
https://metacpan.org/release/WWW-Pocket
Github
https://github.com/doy/www-pocket
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=WWW-Pocket
CPAN Ratings
http://cpanratings.perl.org/d/WWW-Pocket
Jesse Luehrs <doy@tozt.net>
This software is Copyright (c) 2016 by Jesse Luehrs.
This is free software, licensed under:
The MIT (X11) License
To install WWW::Pocket, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WWW::Pocket
CPAN shell
perl -MCPAN -e shell install WWW::Pocket
For more information on module installation, please visit the detailed CPAN module installation guide.