Is there a workaround for non-premium Twitter developers for getting reply_count? - twitter

Does anyone know of a solution for checking if a tweet has replies or not, without checking the reply_count field of the JSON response?
I'm building a crawler and already have a method for scraping a timeline for tweets as well as replies to tweets. In order to increase efficiency I want to find out if a tweet has any replies at all before calling my reply method. I have a standard developer account with Twitter so I do not have access to reply_count.

Looking for this as well. Only way I found was scraping the page (which is against the Terms of Service)
reply-count-aria-${tweet.id_str}.*?(\d+) replies

Related

How can I get list of replies to my tweets using Tweetsharp or using any direct API

I am trying to get list of tweet replies using TweetSharp. I actually need complete list of replies of last x tweets so I am using chain process to get list of tweets first and then their replies. Is there anyone else has done the similar thing? Please help me. Thanks
When you retrieve a user's home timeline, replies to the tweets in that timeline are included, and you could pull the replies out that way.
However, the REST API does not appear to provide a method to return all of the replies to an individual tweet.
The streaming API may be more suited to this, but I have not worked with it.

How should I get all the tweets of an specific hashtag?

I'm trying to develop some code in order to get all the tweets that were generated with certain hashtags, then parse them and finally analyse them. I believe I've already thought and solve the last two parts of this but I'm having some trouble with the first one. I've already read the Twitter Search API documentation but I haven't realised yet how to do this. Can anyone help me?
If you want to retrieve the tweets sent recently, you should use the search/tweets endpoint of twitter' REST API, and mention the hashtag inside q parameter
In case you want to listen to tweets containing the hashtag and receive them in real time, then twitter's streaming API is what you should use (statuses/filter endPoint).
Have a look at the documentation on twitter's website, there's also plenty of information on how to do this all around the web.

how to find out when a link was first tweeted

http://isitold.com/ somehow determines when a link/url was first tweeted. I can't seem to figure out how to do this with the twitter api, does anybody know?
I'd like to use when a link was first tweeted in a time decay function in my app.
You can search tweets with this link using the Twitter Search API to retrieve the oldest tweet possible.
Seems like twitter does not provide historical tweets (search api will not work).
You can get access to historical tweet information with a service like Topsy http://www.topsy.com http://code.google.com/p/otterapi/ (api on topsy).
I have written Who Tweeted It First using YQL and JS to find the oldest tweet for any topic. It is essentially scraping data from the Twitter search page as the official API doesn't return the previous tweets.

How do I know if a specific twitter user is online or not?

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".
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/filter functionality (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 follow parameter. 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:
Tweets created by the user.
Tweets which are retweeted by the user.
Replies to any Tweet created by the user.
Retweets of any Tweet created by the user.
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 user that 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.
It's not clear what you mean by "online" (browsing twitter.com? Using a Twitter app?), but in any case Twitter doesn't provide such information, thankfully.
I'm afraid such information is limited by Twitter and is not available. However you can put your question on https://dev.twitter.com/discussions and ask its developers. Good Luck
you need get user state first
then filter if around current time
then get ids
they are online
use twitter developer api
I do it for my website

How to crawl retweets of a certain user?

I studied the Twitter API Documentation today. Only find that we could use "Twitter REST API Method: statuses user_timeline" to acquire statuses of a certain user. Retweets are stripped out of the user_timeline for backwards compatibility reasons. If I want retweets included, API Documentation recommend "statuses retweeted_by_me", but retweeted_by_me cannot return the retweets by other users.
I think maybe we can analyse the twitter webpage of a certain user to get his retweets. However is there any elegant way to crawl retweets of a certain user?
Thanks in advance!
This was addressed recently by the Twitter devs. You can now add a include_rts=true to your call to user_timeline. See the full discussion here: http://groups.google.com/group/twitter-development-talk/browse_thread/thread/7a4be385ff549ed0
You want to use the retweeted_to_me API call and then create a union with user_timeline and sort by datetime. It's a little annoying that they don't mix the stream for you.
Call statuses/user_timeline for the specific user then for each status you will have to call either statuses/id/retweeted_by or statuses/retweets.
http://apiwiki.twitter.com/Twitter-REST-API-Method:-GET-statuses-id-retweeted_by
http://apiwiki.twitter.com/Twitter-REST-API-Method:-statuses-retweets
You have to manually use GET statuses/retweets/:id for every Tweet from the use_timeline.

Resources