Net::Posterous - read and post from Posterous blogs
my $api = Net::Posterous->new($user, $pass); # Get a list of sites the user owns as Net::Posterous::Site objects my @sites = $api->get_sites; # Set the site to use $api->site($sites[0]); # Create a post my $post = Net::Posterous::Post->new(%opts); my $res = $api->post($post); # Update the post $post->title("New Title"); my $res = $api->post($post); # Get a list of posts my @posts = $api->get_posts; # Get an individual post using the http://post.ly shortcode # i.e 123abc in http://post.ly/123abc my $post = $api->get_post($post->short_code); # Get a list of tags my @tags = $api->get_tags; # Create a post with an video attached my $video = Net::Posterous::Media::Local->new(file => $path_to_movie); my $vpost = Net::Posterous::Media::Post->new( title => "My movie", media => $video ); my $res = $api->post($vpost); # Create a post with a flipbook of pictures my @images = map { Net::Posterous::Media::Local->new(file => $_) } qw(1.jpg 2.jpg 3.jpg); my $ipost = Net::Posterous::Media::Post->new( title => "My flipbook", media => \@images ); my $res = $api->post($ipost); # Add a comment my $comment = Net::Posterous::Comment->new( body => "Nice flipbook!" ); my $res = $api->comment($ipost, $comment);
This allows reading a writing from Posterous sites.
It's very similar to the Posterous module but:
Posterous
Create a new client object.
Requires a username and a password.
Optionally you can pass in either a site id or a Net::Posterous::Site object to specify which site to read/write from.
Net::Posterous::Site
If it's not passed in then it can be passed in later or your default site will be used.
Get or set the current site being used.
May return undef.
Return a Net::Posterous::Site object based on a site id.
Returns undef if the site can't be found.
Get a list of all the user's sites.
Get the posts from a site.
Uses, in order - the site passed in using the option key site, the site set by the user, the default site.
site
The options are
The id of the site to read from
Subdomain of the site to read from
How many posts you want. Default is 10, max is 50.
What 'page' you want (based on num_posts). Default is 1
Only get items with this tag.
Get an id via the http://post.ly short code i.e 123abc in http://post.ly/123abc
Get a list of tags for a site.
Optional. Id of the site to read from
Optional. Subdomain of the site to read from
Post or update a Net::Posterous::Post or <Net::Posterous::Media> object.
Net::Posterous::Post
Add a comment to the post.
Get or set the last error
The way to add media is to create a new Net::Posterous::Media::Local file and then add that to the Net::Posterous::Post object that's going to be created or updated.
Net::Posterous::Media::Local
It will then be turned into a proper Net::Posterous::Media object when the Post is retrieved.
Net::Posterous::Media
The Posterous API docs mention being able to post "common document formats" but there's no docs for it.
I'll add it when I come across it.
The latest code for this module can be found at
https://svn.unixbeard.net/simon/Net-Posterous
Simon Wistow, <simon@thegestalt.org >
<simon@thegestalt.org
Please report any bugs or feature requests to bug-net-posterous at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Net-Posterous. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-net-posterous at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Net::Posterous
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Net-Posterous
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Net-Posterous
CPAN Ratings
http://cpanratings.perl.org/d/Net-Posterous
Search CPAN
http://search.cpan.org/dist/Net-Posterous/
Copyright 2010 Simon Wistow, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Net::Posterous, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::Posterous
CPAN shell
perl -MCPAN -e shell install Net::Posterous
For more information on module installation, please visit the detailed CPAN module installation guide.