GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  WWW::HATENALOGIN (3)

.ds Aq ’

NAME

WWW::HatenaLogin - login/logout interface to Hatena

CONTENTS

SYNOPSIS



  use WWW::HatenaLogin;

  # new login
  my $session = WWW::HatenaLogin->new({
      username => username,
      password => password,
  });

  # login to hatena.com  (optional)
  my $session = WWW::HatenaLogin->new({
      username => username,
      password => password,
      com      => 1,
  });

  # login to hatelabo.jp  (optional)
  my $session = WWW::HatenaLogin->new({
      username => username,
      password => password,
      labo     => 1,
  });

  # do not login with new method
  my $session = WWW::HatenaLogin->new({
      username => username,
      password => password,
      nologin  => 1,
  });

  # WWW::Mechanize option (optional)
  my $session = WWW::HatenaLogin->new({
      username => username,
      password => password,
      mech_opt => {
          timeout    => $timeout,
          cookie_jar => HTTP::Cookies->new(...),
      },
  });

  # logout
  $session->logout;

  # login
  $session->login;

  # Check if already logged in to Hatena
  # If you have a valid cookie, you can omit this process
  unless ($session->is_loggedin) {
      $session->login;
  }

  # get session id
  $session->session_id;

  # get cookie_jar
  $session->cookie_jar;

  # get WWW::Mechanize object
  $session->mech;



DESCRIPTION

WWW::HatenaLogin login and logout interface to Hatena. this module is very simple.

You can easily recycle login data the following WWW::Mechanize object and Cookie data. Please refer to the mech method and the cookie_jar method.

AUTHOR

new ( [\%args] )



  my $session = WWW::HatenaLogin->new({
      username => $username,
      password => $password,
      mech_opt => {
          timeout    => $timeout,
          cookie_jar => HTTP::Cookies->new(...),
      },
      com  => 1, # use to hatena.com server
      labo => 1, # use to hatelabo.jp server
      nologin => 1, # do not login with new method
  });



Creates and returns a new WWW::HatenaLogin object. If you have a valid cookie and pass it into this method as one of mech_opt, you can omit username and password. Even in that case, you might want to check if the user agent already logs in to Hatena using is_loggedin method below.

com field is optional, which will be required if you login to hatena.com.

labo field is optional, which will be required if you login to hatelabo.jp.

nologin field is optional, which will be required if you do not login new method.

mech_opt field is also optional. You can use it to customize the behavior of this module in the way you like. See the POD of WWW::Mechanize for more details.

    is_loggedin ()



  if(!$session->is_loggedin) {
      ...
  }



Checks if $session object already logs in to Hatena.

login ( [\%args] )



  $diary->login({
      username => $username,
      password => $password,
  });



Logs in to Hatena::Diary using username and password. If either username or password isn’t passed into this method, the values which are passed into new method above will be used.

    logout ()



  $session->logout;



Logout by Hatena.

    mech ()



  $session->mech;



return to WWW::Mechanize object.

    cookie_jar ()



  $session->cookie_jar;



return to HTTP::Cookies object. this method same to $session->mech->cookie_jar;

    session_id ()



  $session->session_id;



return to session id. key in cookie is a value of rk.

    login_uri ()



  $session->login_uri;



return to login uri.

    logout_uri ()



  $session->logout_uri;



return to logout uri.

    username (’username’)



  $session->username;
  $session->username(new_username);



username accessor

AUTHOR

Kazuhiro Osawa <ko@yappo.ne.jp>

SEE ALSO

o Hatena

<http://www.hatena.com/>

o WWW::Mechanize

ACKNOWLEDGMENT

some codes copied from WWW::HatenaDiary.

LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 WWW::HATENALOGIN (3) 2008-01-30

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.