
Net::Jaiku - A perl interface to jaiku.com's API

use Net::Jaiku;
my $jaiku = new Net::Jaiku(
username => 'Example',
userkey => 'API Key'
);
my $p = $jaiku->getMyPresence;
print $p->user->url;
my $rv = $jaiku->setPresence(
message => 'Reading a book'
);

This module allows easy access to Feeds, Presences and Users at jaiku.com. It requires an API key retreivable from http://api.jaiku.com/ for each username you wish to authenticate.

This module has a single constructor:
new( ... )
The new constructor takes the following attributes:
<username => $string>
This is a jaiku.com username. this bit.jaiku.com
<userkey => $string>
The user's key can be obtained by visiting http://api.jaiku.com when logged in as the user.
<timeout => $seconds>
The number of seconds to wait before giving up on the call to Jaiku. (Optional)

Net::Jaiku has the following methods:
getFeed()
Returns the public feed as seen on the front page.
getUserFeed( user => $string )
Returns a hashref of the feed for the given user. If no user is specified, it will return the feed for the current user. If no user is logged it, it will return undef.
getMyFeed()
A shortcut to the above method for the logged in user. If no user is logged it, it will return undef.
getContactsFeed()
Retrieve a feed of all your contacts and their presences.
getChannelFeed( channel => $string )
Retrieve a feed of the latest posts to a channel.
Feed methods return an object representing the feed. The following keys are available:
titleurlstream[n]->iconstream[n]->contentstream[n]->created_atstream[n]->created_at_relativestream[n]->commentsstream[n]->urlstream[n]->idstream[n]->titlegetUserPresence( user => $string )
Returns the 'presence' for the given user. If no user is specified, it will return the feed for the current user. If no user is logged it, it will return undef.
getMyPresence()
A shortcut to the above method for the logged in user. If no user is logged it, it will return undef.
Presence methods return an object representing the presence. The following keys are available:
lineuser->avataruser->urluser->nickuser->first_nameuser->last_namesetPresence( message => $string, location => $string_or_arrayref, icon => $integer_or_string, generated => $boolean )
Set the Jaiku presence for the current user. All options are optional, but it would be pointless to not set either a message or a location.
getUserInfo( user => $string )
Returns information for the given user. If no user is specified, it will return the feed for the current user. If no user is logged it, it will return undef.
getMyInfo()
A shortcut to the above method for the logged in user. If no user is logged it, it will return undef.
Info methods return an object representing the information. The following keys are available:
avatarurlnickfirst_namelast_namecontacts[n]->avatarcontacts[n]->urlcontacts[n]->nickcontacts[n]->first_namecontacts[n]->last_name
username( $optional_new_username )
Returns the current username (after optionally setting)
userkey( $optional_new_userkey )
Returns the current username (after optionally setting)

This module returns a custom object called 'HashInflator'. This is used so you can do $rv->user->id rather than the more cumbersome $rv->{user}->{id}
Once the API settles down, I will investigate creating proper objects that will auto-inflate when they need to.

Rick Measham <rickm@cpan.org>

Copyright (c) 2007 Rick Measham. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
