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
WWW::HatenaLogin(3) User Contributed Perl Documentation WWW::HatenaLogin(3)

WWW::HatenaLogin - login/logout interface to Hatena

  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;

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.

  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.

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

Checks if $session object already logs in to Hatena.

  $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.

  $session->logout;

Logout by Hatena.

  $session->mech;

return to WWW::Mechanize object.
  $session->cookie_jar;

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

  $session->session_id;

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

  $session->login_uri;

return to login uri.

  $session->logout_uri;

return to logout uri.

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

username accessor

Kazuhiro Osawa <ko@yappo.ne.jp>

  • Hatena

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

  • WWW::Mechanize

some codes copied from WWW::HatenaDiary.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
2008-01-30 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

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