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


  use XML::Atom::Lifeblog;

  my $client = XML::Atom::Lifeblog->new();

  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);


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


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

  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);


Tatsuhiko Miyagawa <>

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