Can we get the total Retweet_Count per an account OR per Screenname like followers count at user level as followers count is a property associated with user information, Where as Retweet_Count is a field associated with each individual Tweet.
I'm thinking I need to get all the tweets of a user then add the filed Retweet_Count in each & every tweet a user received. Here the problem is the total number of tweets getting using twitter rest api are limited to last 200 tweets (only 2 weeks old tweets in these 200).
We cannot find historical tweets with Streaming API, If we store all the real time tweets using streaming api in our local database then with the use of id of each tweet record in our local data base we need to call twitter rest api call(GET statuses/show/:id) in a loop, then add all the Retweet_Count value in this loop. But due to this the number of restapi calls are increasing to get the total Retweet_Count.
Please suggest me for the better approach.
No, that's not at all possible .
Since the retweet_count associates with each tweet, you need to get all the tweets first.
The reason why i said it's impossible is because if a user has more than 3200 tweets, then you can't get the exact retweet_count as twitter offers only 3200 most recent tweets of a user through GET statuses/user_timeline.
GET statuses/user_timeline method can only return up to 3,200 of a
user’s most recent Tweets. Native retweets of other statuses by the
user is included in this total, regardless of whether include_rts is
set to false when requesting this resource.
One more thing. Some Tweets retweent_count may vary time to time. I mean some may undo retweet & some may retweet old tweet or past week tweet. So, you need to retrieve all the tweets again and again to update-to-date with exact retweet_count. By doing this, there are more chances that you will fall in Twitter's Rate Limit.
Related
As per twitter documentation
A comma-separated list of user IDs, indicating the users whose Tweets should be delivered on the stream. Following protected users is not supported. For each user specified, the stream will contain:
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.
Manual replies, created without pressing a reply button (e.g. “#twitterapi I agree”).
Imagine I am following person X, he/she has millions of follower and whenever he/she tweets something a lot of followers retweet that, as per documentation streaming api will stream all that noise if I am following that id via twitter api. So my question is, is it just bad design or any specific for reason for that.
It's a design choice.
You're looking at a specific method of filtering Tweets (using the follow parameter). If what you want is just the Tweets posted by that user, you could use a different pattern like the from: operator.
I am looking to get the count of how many users were mentioned by a particular user in its tweets for a specific period of time.
I am looking to achieve it in Twitter API 1.1
For example, an arbitrary user #user1 mentioned 20 users in his tweets since last 10 days.
The Twitter REST API 1.1 documentation for the GET statuses/user_timeline method states:
This method can only return up to 3,200 of a user's most recent Tweets. Native retweets of other statuses by the user is included in this total, regardless of whether include_rts is set to false when requesting this resource.
Does this mean one can only traverse the 3,200 newest tweets form a user's timeline?
Does this mean one can only traverse the 3,200 newest tweets form a user's timeline?
Yes, though nothing is stopping you from caching tweets yourself.
I am able to extract tweets, and the submitter's user details using the streaming API, but I also need the list of followers and friends of users posting these tweets.
I am aware that Twitter search API has the friends/ids and followers/ids functions through which one can get the public followers and friends list one user at a time.
But, my data collection requires getting this information for all the users whose tweets I have collected, around 20,000+ users. This is quite exhaustive given the high number of users, and the limitation of one user per call. Moreover, I need to refresh this list for each of these 20,000+ users preferably once a day to observe changes in their friends and followers (if any).
IS there any I can achieve this using the Twitter Streaming API or any other method. Or I have to apply for the Twitter commercial data license?
Thanks!!!
20,000 is way beyond the limits of any normal Twitter API method. I think your going to have to apply for a commercial license to go that high. The streaming API, I believe, tracks 400 keywords and 5000 users max. Your right in that the REST twitter API method only allows you to track one user or a list of ID's. You can take a look at the Twitter Counter API which mines additional info including information about followers, etc. But again, 20,000 I'm sure would be above the limits. Communicate with Twitter, Gnip and, and the Twitter Counter service to see what they can do for you.
Twitter Counter API:
http://twittercounter.com/pages/api?ref=footer
I am integrating Twitter into my mobile app. I am trying to get the friends or follower's ids and nicknames. One solution that I can find out is, using "friends/ids" to get the friends/followers ids, then "user/show" to get the user info.
However, "user/show" returns extended information of the user, if a user has a lot of friends/follower (say 1000), it will be very slow to get nick name of the user.
I wonder if there is any API that only returns ids and nicknames of friends or followers. Or there is other lightweight approach to resolve this issue.
There is no Twitter API call that just returns the screen names. You can use /friends/ids to get the user ids of 5,000 friends with each API call, and then use users/lookup to get the account info on 100 of these at a time. But you are limited to only 350 API calls per hour.
If you are building an app that is based on knowing all of the friends or followers of your users, you need to plan the way you present that. You cannot do what Twitter does, and expect to let someone login and then instantly display all their friends and followers. One way to deal with this is to ask for 24 hours to assemble their complete social network. The other technique is store every user's full profile into a database, so you don't have to look them up again.