XML::Atom::Lifeblog - Post lifeblog items using AtomAPI
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);
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.
<standalone>
$media
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.
filename
filehandle
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:
type
title
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 <miyagawa@bulknews.net>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
XML::Atom::Client http://cognections.typepad.com/lifeblog/2004/12/lifeblog_postin.html
To install XML::Atom::Lifeblog, copy and paste the appropriate command in to your terminal.
cpanm
cpanm XML::Atom::Lifeblog
CPAN shell
perl -MCPAN -e shell install XML::Atom::Lifeblog
For more information on module installation, please visit the detailed CPAN module installation guide.