| WWW-Hatena-WanWanWorld documentation | view source | Contained in the WWW-Hatena-WanWanWorld distribution. |
use WWW::Hatena::Scraper;
## Simple use for.
my $whs = WWW::Hatena::Scraper->new;
my $username = $whs->login('username','password') or die "Login failed!";
my $content = $whs->get_content("http://www.hatena.ne.jp/");
## You can get login cookie and re-login later.
my $rk = $whs->rk;
my $whs2 = WWW::Hatena::Scraper->new;
my $username = $whs2->login($rk) or die "Cookie is invalid or expired!";
## If you want to access Hatelabo, do like this:
my $labo = WWW::Hatena::Scraper->new(labo => 1);
my $username = $labo->login('username','password') or die "Login failed!";
my $content = $labo->get_content("http://www.hatelabo.jp/");
## Logout.
$whs->logout;
$whs2->logout;
$labo->logout;
WWW::Hatena::Scraper is a client for fetching Hatena and Hatelabo's logined pages.
If you have Crypt::SSLeay installed, WWW::Hatena::Scraper will automatically try to login https based login page.
newmy $whs = WWW::Hatena::Scraper->new([ %opts ]);
You can set the ua and labo option in constructor.
If you want to reuse LWP::UserAgent object, set it to this option.
If you set this option 1, login to not Hatena(hatena.ne.jp) but Hatelabo (hatelabo.jp).
Login to Hatena/Hatelabo web sites. Return value is Hatena user id, and if undef returns, login failed.
Fetch $url's web content. $url must be the page of Hatena/Hatelabo. $content is optional, if given, use POST method, or use GET method.
Logout from Hatena/Hatelabo web sites.
Returns user id if login successed.
Returns login cookie if login successed. Give this value to login method later, you can relogin, unless it hasn't expired.
Returns the last error, in form "errcode: errtext"
Returns the last error code.
Returns the last error text.
This module is Copyright (c) 2006 OHTSUKA Ko-hei. All rights reserved.
You may distribute under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file. If you need more liberal licensing terms, please contact the maintainer.
This is free software. IT COMES WITHOUT WARRANTY OF ANY KIND.
Hatena website: http://hatena.ne.jp/ Hatelabo website: http://hatelabo.jp/
WWW::Hatena::WanWanWorld -- part of this module
OHTSUKA Ko-hei <nene@kokogiko.net>
| WWW-Hatena-WanWanWorld documentation | view source | Contained in the WWW-Hatena-WanWanWorld distribution. |