使用TwitterAPI 1.1版本检索USER_时间线的最简单的PHP示例

使用TwitterAPI 1.1版本检索USER_时间线的最简单的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(最近的状态)?

我发现了这个:https:/dev.twitter.com/docs/api/1.1/get/statins/user_time但我得到了以下错误:

"{"errors":[{"message":"Could not authenticate you","code":32}]}"

这里有很多类,但在尝试了几个之后,似乎没有一个是因为Twitter上的这些更新而起作用的,而且其中一些是相当高级的类,有很多我并不真正需要的功能。

用PHP获取最近用户状态的最简单/最短的方法是什么?


红糖糍粑
浏览 547回答 3
3回答
打开App,查看更多内容
随时随地看视频慕课网APP