/**
 * Posts an update on Ping.fm.
 *
 * @param $post_method
 *   Posting method.  Either "default", "blog", "microblog" or "status."
 * @param $body
 *   Message body.
 * @param $title
 *   Title of the posted message.  This will only appear if the specified
 *   service supports a title field.  Otherwise, it will be discarded.
 * @param $account
 *   The user object that is posting the message. If nothing is passed,
 *   then it is assumed to be the currently logged in user.
 */
function pingfm_post($body, $post_method = 'default', $title = NULL, $account = NULL) {
  if (!isset($account)) {
    global $user;
    $account = $user;
  }
  if ($dev_key = variable_get('pingfm_dev_key', NULL) && isset($account->pingfm_app_key)) {
    module_load_include('php', 'pingfm', 'phpingfm/PHPingFM');
    $phpingfm = new PHPingFM($dev_key, $account->pingfm_app_key, variable_get('pingfm_debug', FALSE));
    return $phpingfm->post($post_method, $body, $title);
  }
}