为了账号安全,请及时绑定邮箱和手机立即绑定

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

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

PHP
红糖糍粑 2019-06-06 10:54:55
使用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获取最近用户状态的最简单/最短的方法是什么?
查看完整描述

3 回答

  • 3 回答
  • 0 关注
  • 546 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信