NAME

XML::Atom::Lifeblog - Post lifeblog items using AtomAPI

SYNOPSIS

use XML::Atom::Lifeblog;

my $client = XML::Atom::Lifeblog->new();
$client->username("Melody");
$client->password("Nelson");

my $entry = $client->postLifeblog($PostURI, $title, $body, "foobar.jpg");

my $media = XML::Atom::Lifeblog::Media->new(content => $data);
my $entry = $client->postLifeblog($PostURI, $title, $body, $media);

DESCRIPTION

XML::Atom::Lifeblog is a wrapper for XML::Atom::Client that handles Nokia Lifeblog API to post images associated with text messages.

METHODS

XML::Atom::Lifeblog is a subclass of XML::Atom::Client.

postLifeblog
my $entry = $client->postLifeblog($PostURI, $title, $body, $media);

Creates a new Lifeblog entry and post it to a Lifeblog aware server using <standalone> element. $media is either a XML::Atom::Lifeblog::Media object, or a filepath of media file to be posted.

Returns XML::Atom::Entry object for the posted entry.

There're several ways to create Media object. At least you should specify how to fetch media data. filename, filehandle or content.

# create Media object
# Content-Type is auto-guessed and media title is auto-determined
my $media = XML::Atom::Lifeblog::Media->new(filename => "foo.jpg");
my $media = XML::Atom::Lifeblog::Media->new(filehandle => $fh);
my $media = XML::Atom::Lifeblog::Media->new(content  => $data);

If you omit other parameters like type and title, they're automatically guessed and generated using MIME type and file magic. If you want to specify them explicitly, you can do this like:

my $media = XML::Atom::Lifeblog::Media->new(
    filehandle => $fh, type => "video/3gpp", title => "My dog.3gp",
);

# Then post it with $title & $body to $PostURI
my $entry = $client->postLifeblog($PostURI, $title, $body, $media);

AUTHOR

Tatsuhiko Miyagawa <miyagawa@bulknews.net>

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

XML::Atom::Client http://cognections.typepad.com/lifeblog/2004/12/lifeblog_postin.html