このコードが機能しないのはなぜですか? 検索タグ「犬」の最新のツイートを取得し、検索タグ「犬」を含むツイートを送信したユーザーに返信するステータス更新を送信するために必要です。ここにある Abraham の twitteroauth を使用しています: https://github.com/abraham/twitteroauth/downloads
<?php
require_once('twitteroauth.php');
define('CONSUMER_KEY', 'CONSUMERKEYHERE');
define('CONSUMER_SECRET', 'SECRET HERE');
define('ACCESS_TOKEN', 'TOKENHERE');
define('ACCESS_TOKEN_SECRET', 'TOKENSECRETHERE');
$twitter = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET);
$twitter->host = "http://search.twitter.com/";
$search = $twitter->get('search', array('q' => 'dog', 'rpp' => 5));
$twitter->host = "https://api.twitter.com/1/";
foreach($search->results as $tweet) {
$status = '@$tweet->from_user Here my reply would go';
$twitter->post('statuses/update', array('status' => $status));
}
?>
コンシューマ キー、シークレット、およびトークンを入力しましたが、ここで削除しました。
ありがとう!