WWW::Mixi::OO::Session - WWW::Mixi::OO's session class
use WWW::Mixi::OO::Session; my $mixi = WWW::Mixi::OO::Session->new( email => 'foo@example.com', password => 'password'); $mixi->login; my @friends = $mixi->page('list_friend')->fetch; # ...
WWW::Mixi::OO::Session is WWW::Mixi::OO session class.
my $mixi = WWW::Mixi::OO::Session->new( email => $email, password => $password, encoding => $encoding, [rewriter => sub { WWW::Mixi::OO::Util->rewrite(shift); }], );
WWW::Mixi::OO constructor.
mixi email address.
mixi password.
internal encoding (necessary!)
coderef to rewriter, into text
$mixi->email('foo@example.com'); my $email = $mixi->email;
set/get mixi email address
$mixi->password('foobar'); my $email = $mixi->password;
set/get mixi password
$mixi->rewriter->('<foo>bar</foo>');
get/set rewriter (into text).
$mixi->encoding('euc-jp');
get/set internal encoding.
see also WWW::Mixi::OO::I18N.
my $res = $mixi->response;
get last response
my $data = $mixi->content;
get last content
# call my $cache = $mixi->cache(ref($this)); # or in Page subclass my $cache = $page->cache;
get/set cache
$mixi->login
login to mixi.
$mixi->page($pagename);
get page(mixi's class)
$mixi->page_to_class($pagename);
get classname from pagename
$mixi->class_to_page($classname);
get pagename from classname
$mixi->save_cookies($file);
save cookies to file
$mixi->load_cookies($file);
load cookies to file
croak 'please login!' unless $mixi->is_logined;
return true if logined
croak 'please login before this method' if $mixi->is_login_required;
return true if login required
# call (for example only, check_logined method has this code already) if ($mixi->is_login_required) { if ($mixi->can_login) { $mixi->login; } else { croak "Couldn't login to mixi!"; } }
return true if we are able to login to mixi
$mixi->check_logined; $mixi->get(...);
if didn't login, try login or die.
my $session_id = $mixi->session_id;
return session id
$mixi->set_content($uri);
set content to specified resource
$mixi->refresh_content;
refresh content
my @options = $mixi->analyze_uri($uri);
analyze URI and return options.
my $uri = $mixi->relative_uri('http://mixi.jp/login,pl');
generate relative URI from mixi.
my $uri = $mixi->absolute_uri('login');
generate absolute URI from mixi
my $uri = $mixi->absolute_linked_uri('foo.pl?bar=baz...');
generate absolute uri from link(or other relative URIs)
my $res = $mixi->post('login', foo => bar, baz => qux);
http/post to mixi.
my $res = $mixi->get('home');
http/get to mixi.
see WWW::Mixi::OO::I18N.
WWW::Mixi::OO, LWP::UserAgent, WWW::Mixi::OO::Util
Topia <topia@clovery.jp>
Copyright (C) 2005 by Topia.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.
To install WWW::Mixi::OO, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WWW::Mixi::OO
CPAN shell
perl -MCPAN -e shell install WWW::Mixi::OO
For more information on module installation, please visit the detailed CPAN module installation guide.