function twitter_actions_post in Twitter 7.5
Silently posts a message to Twitter
Only displays a message on error.
Parameters
int $twitter_uid: The unique identifier of a Twitter acount.
string $message: The message to post.
2 calls to twitter_actions_post()
- twitter_actions_set_status in twitter_actions/
twitter_actions.rules.inc - Fetches Twitter account info and submits with the message to the Twitter API.
- twitter_actions_set_status_action in twitter_actions/
twitter_actions.module - Implementation of a configurable Twitter action. @todo Implementation for language negotiation for the body and sumary. Also need implementation for bodies with multiple values. Right now it is hard coded and it will only get body and summary for…
File
- twitter_actions/
twitter_actions.module, line 268 - Exposes Drupal actions for sending Twitter messages.
Code
function twitter_actions_post($twitter_uid, $message) {
module_load_include('inc', 'twitter');
$twitter_account = twitter_account_load($twitter_uid);
try {
twitter_set_status($twitter_account, $message);
} catch (TwitterException $e) {
drupal_set_message(t('An error occurred when posting to Twitter. Check the system log for details.'), 'error');
}
}