Skip to content

Instantly share code, notes, and snippets.

@nobodyplace
Created October 12, 2010 08:19
Show Gist options
  • Save nobodyplace/621841 to your computer and use it in GitHub Desktop.
Save nobodyplace/621841 to your computer and use it in GitHub Desktop.
Services_Twitterを使ってダイレクトメッセージ
<?php
//PEAR::Services_Twitter
require_once 'Services/Twitter.php';
//PEAR::HTTP_OAuth::Consumer
require_once 'HTTP/OAuth/Consumer.php';
//instance
$twitter = new Services_Twitter();
$oauth = new HTTP_OAuth_Consumer($consumerKey, $consumerSecret, $authToken, $authTokenSecret);
$twitter->setOAuth($oauth);
//send new direct message
$twitter->direct_messages->new($user, $message);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment