使用TwitterAPI 1.1版本檢索USER_時(shí)間線的最簡(jiǎn)單的PHP示例由于TwitterAPI 1.0的退出2013年6月11日,下面的腳本不再工作了。// Create curl resource $ch = curl_init(); // Set url curl_setopt($ch, CURLOPT_URL,
"http://twitter.com/statuses/user_timeline/myscreenname.json?count=10");
// Return the transfer as a string curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// $output contains the output string $output = curl_exec($ch);
// Close curl resource to free up system resources curl_close($ch);if ($output) {
$tweets = json_decode($output,true);
foreach ($tweets as $tweet)
{
print_r($tweet);
}}如何以最少的代碼獲得user_time(最近的狀態(tài))?我發(fā)現(xiàn)了這個(gè):https:/dev.twitter.com/docs/api/1.1/get/statins/user_time但我得到了以下錯(cuò)誤:"{"errors":[{"message":"Could not authenticate you","code":32}]}"這里有很多類,但在嘗試了幾個(gè)之后,似乎沒有一個(gè)是因?yàn)門witter上的這些更新而起作用的,而且其中一些是相當(dāng)高級(jí)的類,有很多我并不真正需要的功能。用PHP獲取最近用戶狀態(tài)的最簡(jiǎn)單/最短的方法是什么?
- 3 回答
- 0 關(guān)注
- 555 瀏覽
添加回答
舉報(bào)
0/150
提交
取消