NAME
Net::PingFM - Interact with ping.fm from perl
SYNOPSIS
# Make pingfm object with our user and api keys:
my $pfm = Net::PingFM->new( user_key => 'blah',
api_key => 'foo' );
# check they like our keys (you don't need to do this!)
$pfm->user_validate or die 'Couldn\'t log in to ping.fm!';
# make a post using our default method:
$pfm->post( 'Hello ping.fm!' );
# make a microblog post:
$pfm->post( 'Testing Net::PingFM' , { method => 'microblog' } );
# make a real blog post, with title and everything!
$pfm->post( 'Testing Net::PingFM. Hours of fun..',
{ method => 'blog', title => 'Testing Testing!'} );
DESCRIPTION
Simple little module for posting to http://ping.fm/
STATUS
Currently the library can do basic posting to different services, and that's about it!
CONSTRUCTOR
Your user and application keys are required). Module will die without them.
my $pfm = Net::PingFM->new( api_key => 'blah', user_key => 'blah' );
Additional constructor parameters:
debug_mode => 1, # will stop posts from actually appearing dump_responses => 1 # will cause us to print our XML responses for debug
METHODS
user_validate
if ( $pfm->user_validate ){
# we have a valid user key
}
else{
# we don't!
}
Validate the user's application key. Returns true value if the user key is OK and false otherwise.
post
$pfm->post( $body , \%optional_params );
$pfm->post( 'Hacking on Net::PingFM', { post_method => 'status' });
$pfm->post( 'Posting using my default method' );
Post! We at least need a $body which is the body of the post we'll send to ping.fm.
Optional parameter hashref can contain:
post_method => What you would like to post to. method => shorthand for post_method
Valid post_method's are blog, microblog, status and default. Default will use your default post method on ping.fm. Default is our default! 'method' is a less cumbersome option to type, if for some reason you choose to use both parameters then 'post_method' is the one which will be used.
title => The title for the post. Ping.fm requires this for post_method 'blog' but we don't enforce that in the module!
service => Just post to one service
last_error
Last error message we were sent from ping.fm
ERROR HANDLING
If something goes wrong at the network or XML parsing level the methods will die. If things go wrong at the API level, as in ping.fm gives us an actual error then the method will generally return false and set last_error with an error message from ping.fm.
MOOSE!
This is implemented using moose, so can be messed with in a moosey way if you feel like it!
API INFO
http://groups.google.com/group/pingfm-developers/web/api-documentation
AUTHOR
Joe Higton
COPYRIGHT
Copyright 2008 Joe Higton
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.