function messaging_twitter_send_at in Messaging 6.3
Same name and namespace in other branches
- 6.4 messaging_twitter/messaging_twitter.module \messaging_twitter_send_at()
- 6 messaging_twitter/messaging_twitter.module \messaging_twitter_send_at()
- 6.2 messaging_twitter/messaging_twitter.module \messaging_twitter_send_at()
Send a direct message to Twitter user
1 string reference to 'messaging_twitter_send_at'
- messaging_twitter_messaging in messaging_twitter/
messaging_twitter.module - Implementation of hook_messaging
File
- messaging_twitter/
messaging_twitter.module, line 84 - Messaging Twitter sending method
Code
function messaging_twitter_send_at($destination, $message, $params = array()) {
_messaging_twitter_include();
$content = $message
->render('twitter');
$url = 'http://twitter.com/statuses/update.xml';
$site_username = variable_get('messaging_twitter_username', '');
$site_password = variable_get('messaging_twitter_password', '');
$body = '@' . $destination . ' ' . $content->body;
$headers = array(
'Authorization' => 'Basic ' . base64_encode($site_username . ':' . $site_password),
'Content-type' => 'application/x-www-form-urlencoded',
);
$data = 'status=' . urlencode($body);
$result = drupal_http_request($url, $headers, 'POST', $data);
}