NAME

WWW::Hatena::WanWanWorld - Client class to access Hatena Wan Wan World

SYNOPSIS

use WWW::Hatena::WanWanWorld;

## Login
my $www = WWW::Hatena::WanWanWorld->new;
my $username = $www->login('username','password') or die "Login failed!";

## Prepare
$www->position(35.657540,139.702341);
$www->voice('BowWow!!');

## To set own position and voice, and get around users in 2km.
my $arounds = $www->get_around(2);

## To get own friend.
my $friends = $www->get_friend;

## To get markers (house, or so) in 2km around.
my $markers = $www->get_marker(2);

## To add other user to own friend.
$www->add_friend("otheruser");

## To add other user to own friend.
$www->delete_friend("otheruser");

## To put own house here.
$www->add_house;

## Logout.
$www->logout;

DESCRIPTION

WWW::Hatena::WanWanWorld is a client to operate your own dog in Hatena Wan Wan World from perl.

CONSTRUCTOR

new

my $www = WWW::Hatena::Scraper->new([ %opts ]);

You can set the ua option in constructor.

ua

If you want to reuse LWP::UserAgent object, set it to this option.

METHODS

$www->login($userid,$password)
$www->login($cookie)

Login to Hatena Wan Wan World. Return value is Hatena user id, and if undef returns, login failed.

$www->logout

Logout from Hatena Wan Wan World.

$www->user

Returns user id if login successed.

$www->rk

Returns login cookie if login successed. Give this value to login method later, you can relogin, unless it hasn't expired.

$www->position($latitude,$longitude)
$www->position

Set or get user's(dog's?) position in latitude,longitude array.

$www->lat($latitude)
$www->lat

Set or get latitude of user's(dog's?) position.

$www->long($longitude)
$www->long

Set or get longitude of user's(dog's?) position.

$www->voice($voice)
$www->voice

Set or get user's(dog's?) voice to show.

$www->charcode($charcode)

Set character code of voice string. Module detect character code automatically, but sometimes may failed. You want to make it clear, use set character code to this method.

$www->get_around($km)

Send position and voice data to Hatena Wan Wan World's server. Return object is, other user's list of around $km kilo meters. Object is just raw hash-ref translated from JSON response. If $km value is too big, (maybe $km > 9), server returns no value. This may specification of Hatena Wan Wan World.

$www->arounds

Return same object of get_around method returns. You can get it later by this method.

$www->get_friend

Return object is, friend's list of user. Object is just raw array-ref translated from JSON response.

$www->friends

Return same object of get_friend method returns. You can get it later by this method.

$www->get_marker($km)

Return object is, marker (house, or so) list of around $km kilo meters. Object is just raw hash-ref translated from JSON response.

$www->markers

Return same object of get_marker method returns. You can get it later by this method.

$www->add_friend($username)

Add other user to user's friend. Return 1 if succesed, 0 if failed.

$www->delete_friend($username)

Delete other user to user's friend. Return 1 if succesed, 0 if failed.

$www->add_house

Build user's own house at user's position.

$www->err

Returns the last error, in form "errcode: errtext"

$www->errcode

Returns the last error code.

$www->errtext

Returns the last error text.

NOTICE

Area detectation(calcurating minimum and maximum longitude/latitude) logic of get_around method and get_marker method is just poor hacked. It is only work around in Japan, typically not worked near the pole.

All raw objects translated from JSON has mistakes. In these object, attribute lat means longitude, lng means latitude. This is error of Hatena itself. Take care. In perl API, there are no such mistakes.

TODO

Make user-friendry class to handle objects translated from JSON.

COPYRIGHT

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.

WARRANTY

This is free software. IT COMES WITHOUT WARRANTY OF ANY KIND.

SEE ALSO

Hatena Wan Wan World website: http://world.hatelabo.jp/

WWW::Hatena::Scraper -- part of this module

AUTHORS

OHTSUKA Ko-hei <nene@kokogiko.net>

1 POD Error

The following errors were encountered while parsing the POD:

Around line 197:

'=item' outside of any '=over'