How do I know if a specific twitter user is currently online by writing programs? Is there any API or data field in the web page showing this information? Both browsing Twitter webpage and using Twitter app are considered “online”.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Although this information is not readily available, you can do a work around. Make use of Twitter’s Streaming API: https://dev.twitter.com/docs/streaming-apis/streams/public (have a read through this document).
You’ll most likely be using the
POST Statuses/filterfunctionality (read the doc here: https://dev.twitter.com/docs/api/1/post/statuses/filter ), which will give you a JSON object with tweets based on your filters.Make use of the parameters you’ll need to specify in the URL to filter the stream (have a look through this document to learn more about it: https://dev.twitter.com/docs/streaming-apis/parameters ), in your case it’ll be the
followparameter. You basically specify the twitter ID of the user you want to follow. Here’s a sample JSON result of the streaming API in action https://stream.twitter.com/1/statuses/filter.json?follow=25365536 – this one in particular is following Kim Kardashian. Keep in mind that this will give you:So in order to just stream the tweets of your desired user, you’ll have to use a programming language of your choice to parse through the JSON object to find the
userthat actually sent the tweet (this is a little tricky, you’ll have to look through the properties of the JSON object to figure it out). Once you narrow the streaming tweets to just the ones from the user though, you can then have an alert on when new tweets by this user stream and that will tell you if the user is online/using twitter at the moment.