Hatena::API::Auth - Perl intaface to the Hatena Authentication API
Version 0.04
use Hatena::API::Auth; my $api = Hatena::API::Auth->new({ api_key => '...', secret => '...', }); my $uri = $api->uri_to_login; print $uri->as_string; my $cert = $q->param('cert'); my $user = $api->login($cert) or die "Couldn't login: " . $api->errstr; $user->name; $user->image_url; $user->thumbnail_url;
A simple interface for using the Hatena Authentication API http://auth.hatena.ne.jp/.
Returns an instance of Hatena::API::Auth. It requires two parameters, "api_key" and "secret" which can be retrieved from the Web site of Hatena Authentication API (http://auth.hatena.ne.jp/).
Returns a URI object which is associated with the login url and required parameters. You can also use this method in your templates of Template like this:
<a href="[% api.uri_to_login %]">login</a>
uri_to_login takes extra URI parameters as arguments like this:
uri_to_login
<a href="[% api.uri_to_login(foo => 'bar', bar => 'baz') %]">login</a>
Then extracted URI will have extra URI parameters such as foo=bar&bar=baz. Those parameters will be passed to the Authentication API. They will be returned to your application as query parameters of the callback URL.
foo=bar&bar=baz
Logs into Hatena with a Web API and returns a Hatena::API::Auth::User object which knows some information of the logged user. It requires "cert", which can be retrieved from the web site, as an argument.
The user object has some accessor for user's information.
Returns an account name on Hatena.
Returns a url of a user's profile image.
Returns a url of a thumbnail of user's profile image.
An internal method for generating signatures.
Set/Get HTTP a user-agent for custormizing its behaviour.
Naoya Ito, <naoya at bloghackers.net>
<naoya at bloghackers.net>
Please report any bugs or feature requests to bug-hatena-api at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Hatena-API-Auth. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-hatena-api at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Hatena::API::Auth
You can also look for information at:
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Hatena-API-Auth
CPAN Ratings
http://cpanratings.perl.org/d/Hatena-API-Auth
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Hatena-API-Auth
Search CPAN
http://search.cpan.org/dist/Hatena-API-Auth
Hatena Authentication API http://auth.hatena.ne.jp/ Hatena http://www.hatena.ne.jp/
Copyright 2006 Naoya Ito, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Hatena::API::Auth, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Hatena::API::Auth
CPAN shell
perl -MCPAN -e shell install Hatena::API::Auth
For more information on module installation, please visit the detailed CPAN module installation guide.