Trying to use StatusListener in twitter4j for listening to tweets from a particular user, and then respond to them.
But StatusListener seems to be unreliable. It seems to "hear" certain tweets but not others.
For instance when the user i am listening to sends a tweet, only sometimes does it get captured by my status listener, and it never gets captured if the tweet contains a photo for some reason, which is a problem because the user i want to listen to tweets photos every time!
This also seems to be the case for sending rgb codes like 0x234578
Is there something stopping status listener picking up these tweets?!
I am using the exact code from example number 9 at the bottom of this link: http://twitter4j.org/en/code-examples.html
sample():
Starts listening on random sample of all public statuses.
This method is meant for getting a sample of tweets.
The example number 9 you mentioned is sample stream. (http://twitter4j.org/javadoc/twitter4j/TwitterStream.html)
You have to use UserStream
, not SampleStream
(Check method user()
)
Check out this example: