I have created the program for getting tweets from twitter using streaming api.
For that I have used tmhOAuth library with PHP.
My code always shows timeout error.
Can any one tell me how to write the program to getting tweets with follow id using streaming api?
Any suggestions would be appreciated!!!

Replies
Where are you seeing the timeout error? How are you running the PHP script? (hint: if you're not executing it via the command line, you're doing it wrong - see the instructions in https://github.com/themattharris/tmhOAuth/blob/master/examples/streaming.php).
Thanks for your reply Arne!
I have used the following code,
<?php}?>But while using track instead of follow I got the resulted tweets,
when using follow only I got empty string as result, refer below result
string ' ' (length=2)
array
'start' => int 1336751048
'interval_start' => int 1336751048
'tweets' => int 1
'last_tweets' => int 0
'bytes' => int 0
'last_bytes' => int 0
What's problem exist here?
Can I run it in browser?
Thanks for your suggestion Arne!
I have used the following code,
<?php}?>while using track instead of follow I got the resulted tweets. I got the empty tweets when using follow as parameter.
What's the problem here?
I am using the URL https://stream.twitter.com/1/statuses/filter.json with the parameter 'follow' as 'AAAAAAAAA' for test.
$params = array(
'follow' => 'follower_id',
}
But it always returns empty string.
Is there any way to retrieve tweets?
I can play streaming with track keyword but can't include follow id for the particular user.
I am using tmhOAuth with PHP..How to use follow id with streaming..
Is follow id is nothing but user id?
anyone there?
I'm not sure I understand what the problem you're having is. When you pass a user ID to the follow parameter, it needs to be a numerical ID -- not the user's screen name. Once connected, your stream should persist for a long while -- you may not get much data back if there's no activity around the users you've indicating with the follow parameter.
Thanks Taylor...
I have consumer_key,consumer_secret_key,user_token,user_secret keys.(This is my application keys)
I have followed Mr.X and Mr.X also followed me. Now i need to get the tweets of Mr.X. I have gave Mr.X's userid to follow parameter. Now here which tweets shall I receive?..Mr.X sent tweet to me...may I got these tweets?
When using "follow" param in tmhOAuth streaming api it always shows the empty string as result. But there has tweets around that user.
In tmhOAuth.php file we have to change anything? (Eg. User agent)
I have changed consumer_key,consumer_secret_key,user_token,user_secret keys.(all my own test application keys).
Anyone worked out streaming with follow using tmhOAuth? Is it working?
Please give me the suggestion...Anything will be appreciated.
Can you detail the steps you're following again? How are you measuring the tweets around a user?
We made a massive update to our Streaming API documentation yesterday -- I recommend taking a look and seeing if it can answer some of the questions you're having: The Streaming APIs
I have gone through your updated Streaming api documentation. It's really very clear and informative.Now I move on to my problem..
I have followed Mr.X and Mr.X also followed me and Mr.Y. I have sent tweets to Mr.X and also Mr.X sent tweets to Mr.Y. Now I need to get the tweets of Mr.X(Tweets around the user is present becoz Mr.X sent tweets to Mr.Y).
For that I have gave Mr.X's userid in follow parameter. Also I have put all my keys like consumer_key,consumer_secret_key,user_token,user_secret keys(This is my application keys) for authentication. I am using statuses/filter.json POST method and setting the user agent as my test application(Eg: "Testapp (http://testapp.com/twit/)")...These are all about my coding. For this I have always received the empty string as result and the response code as 200. Do u know why this problem occurs?...May i know where am wrong? Any suggestions would be greatly appreciated. Thanks!!!
Anyone?
In tmhOAuth.php file user_agent variable is there na. Is that variable value is nothing but the owner of the consumer_key,consumer_secret_key,user_token,user_secret key's application name? Which value we have to assign for that variable?
anyone there?
https://github.com/themattharris/tmhOAuth/master/examples/streming.php
this url is not working can i get any other?
The examples for that library moved to a different project, see: https://github.com/themattharris/tmhOAuth-examples/blob/master/streaming.php