1
votes

I want to read my own twit in a litte localhost application in js + php.
I know how to read the json in api.twitter.com/1/statuses/user_timeline.json?screen_name=myName but due to the limit rate I need to make a User Stream (https://dev.twitter.com/docs/streaming-api/user-streams)

I have my 4 keys by create a dev account :

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

So I try with this https://github.com/themattharris/tmhOAuth/blob/master/examples/userstream.php

  1. download the lib
  2. run my MAMP (or WAMP or LAMP)
  3. open the example, put my key
  4. go to the page
  5. and nothing. except the browser loader.

Why this hapeens?

  1. is it due to localhost ?
  2. or no params ?
  3. or new twitter restriction ?
1

1 Answers

1
votes

Streaming API is not right tool for litte application You are better off with plain REST API.

Streaming API application is not supposed to be run in browser; don't forget to set_time_limit(0) and start your .php script in comandline - where it will run forever (you should save tweets in database so your normal browser scripts could display them)