The Post method

The post method is the most crucial method of all - it posts status updates, blog posts, and micro-blog posts to Ping.fm.

Parameters

It takes four parameters:
$post_method
The method to post with - can be "blog", "microblog", or "status".
$body
The body of the post.
$title (optional)
The title of the post - only used if $post_method is set to "blog".
$services (optional)
The name of a service or an array of services to post to.

Return value

It returns a boolean, for whether the post was successful or not. An example of something un-successful would be attempting to post to a service which does not match the post method.

Example usage:

This is perhaps the most basic example:
<?php
$PHPingFM 
= new PHPingFM($developer_key$user_app_key);
$posted $PHPingFM->post("status""Working with Ping.fm's API, and posting a first sample update.");
?>

More advanced usage.

You could, for example, build a form to post to Ping.fm (since we have turned on the $debug parameter, the posts will not actually be posted anywhere).



The code behind that

<?php
$PHPingFM 
= new PHPingFM($developer_key$user_app_key);
$result $PHPingFM->post("status"$_POST['post']);
if (!
$result) {
  
$output '<div class="error">There was an error in posting.</div>';
}
else {
  
$output '<div class="success">Post was posted successfully.</div>';
}
?>