I am trying to listen to a number of users' (specific users) tweets in real-time using the Twitter API, but I have not been able to find any documentation regarding this. I have found lots of info about listening to tweets that use a certain hashtag or keyword but no info about listening to all tweets from certain users in real-time.
With the Twitter4J API I was able to specify a number of users, create a stream and then have a piece of code run whenever one of the users tweeted. How could I accomplish this with PHP?
From https://dev.twitter.com/streaming/reference/post/statuses/filter
follow
A comma-separated list of user IDs, indicating the users whose Tweets should be delivered on the stream.
So, if you POST John,Paul,George,Ringo
you will get a stream which includes:
Late response, but have you seen this?
https://developer.twitter.com/en/docs/accounts-and-users/subscribe-account-activity/overview
The Account Activity API provides you the ability to subscribe to realtime activities related to a user account via webhooks. This means that you can receive realtime Tweets, Direct Messages, and other account events from one or more of your owned or subscribed accounts through a single connection.
You will receive all related activities below for each user subscription on your webhook registration:
Please note - We do not deliver home timeline data via the Account Activity API. Please use the GET statuses/home_timeline to pull this data.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With