twitter api中的用户流

问题描述:

我想在js + php的litte localhost应用程序中阅读我自己的twit。
我知道如何在api.twitter.com/1/statuses/user_timeline.json?screen_name=myName但由于限速阅读JSON我需要一个用户流(https://dev.twitter.com/docs/streaming-api/user-streamstwitter api中的用户流

我通过创建一个开发的帐户中有我的4个按键:

'consumer_key' => '*****', 
'consumer_secret' => '*****', 
'user_token' => '*******', 
'user_secret' => '******', 

所以我尝试用这个https://github.com/themattharris/tmhOAuth/blob/master/examples/userstream.php

  1. 下载的lib
  2. 运行我的甲基苯丙胺(或WAMP或灯)
  3. 打开示例,放入我的钥匙
  4. 转到页面
  5. 没有。浏览器加载器除外。

为什么这hapeens?

  1. 这是由于localhost?
  2. or no params?
  3. 或新的Twitter限制?

流式API不适合litte应用程序您最好使用普通的REST API。

流API应用程序不应该在浏览器中运行;请不要忘记set_time_limit(0)并在comandline中启动您的.php脚本 - 它将永远运行(您应该在数据库中保存推文,以便您的正常浏览器脚本可以显示它们)