我試圖找到一種方法來使用主Twitter API來搜索使用PHP的推文。最新的1.1文檔說這應該是可能的。我不想使用http://search.twitter.com API。PHP - 使用Twitter API 1.1搜索#標籤
我已經建立了一個Twitter應用程序,並使用消費者,祕密等鍵通過亞伯拉罕的twitteroauth(https://github.com/abraham/)連接到它。我可以使用這種方法從Twitter中抽出我自己的時間表和我自己的生物信息,但是當我嘗試使用搜索時,它失敗地說「查詢參數丟失」。
我使用下面的代碼從Git倉庫稍微修改test.php的:
$parameters = array('q' => 'qwerty');
twitteroauth_row('search/tweets', $connection->get('search/tweets'), $connection->http_code,$parameters);
/* users/search */
$parameters = array('q' => 'brenmurrell');
twitteroauth_row('users/search', $connection->get('users/search', $parameters), $connection->http_code, $parameters);
/* statuses/public_timeline */
twitteroauth_row('statuses/user_timeline', $connection->get('statuses/user_timeline'), $connection->http_code,'q=twitpic');
最後兩個調用按預期工作,第一個沒有。我得到一個400 HTTP錯誤,特定的API錯誤代碼爲25(查詢參數缺失)。
我錯過了什麼嗎?任何人都可以幫助解決這可能出錯的地方,或者如果這是真正破壞的功能?
查看此答案。它爲我工作。 http://stackoverflow.com/questions/12873409/twitter-oauth-users-search-works-but-search-tweets-does-not –