STTwitter Collect people i mention and those who mention me - twitter

using STTwitter Library I'm planing to go back in time and Collect as much as i can the Ids of those people who mention me and i mention them as well and store them within the app itself .
Can anyone tell me how to achieve this ?

To get mentions of yourself in other's tweets, use this method.
To get mentions of others in your own tweets, use this one and look at tweet entities.
You may have to play with the count value, and also call the methods again while setting maxID to the lowest ID you've always have.
Let me know if it doesn't fulfill your needs.

Related

Youtube API Ratings

I am using YouTube API in one of my projects. In some cases I find that the "gd$rating" is not present in the response I receive . What can be the possible reasons for this ? Is there a work around to get the same ?
This sounds like a classic example of "don't always trust the API return values to be wholly complete or accurate". You will most likely have to anticipate this sort of thing happening in your code. Even if it is defined in the API.
For example: https://developers.google.com/youtube/2.0/reference#youtube_data_api_tag_gd:rating
From the docs: gd$rating This element is only returned if the video has been rated.

Is it possible to get the YouTube author name for a video using the v3 api?

So I'm working on switching to using the v3 version of the YouTube api (which is so much better it's like a completely different product), but I'm either missing something or it is ...
Being able to fetch an arbitrary list of videos, and their details, in one call is going to make life significantly better, but in the videos list method, the the video details "snippet" contains the "channelId", not the "author".
I've spent quite a bit of time looking through the documentation, but can't find any way of getting from a channelId to the human readable author name.
How am I expected to map a video to an author?
It's not possible to get back a display name (either legacy YouTube name or Google+ name) for a channel as part of the video.snippet response. You need to take the channelId and perform a channels.list(id=channelId1,channelId2,...,part=snippet) operation to get that information. The good part is that you can pass in up to 50 channel ids in a single call.
This sort of separation of information into different resources with ids effectively serving as keys linking the resources was a deliberate decision. The engineering team is aware that it will require developers to make an additional API call, but they're in favor of that design.
At the same time, the API is still in an experimental release, and if you have any feedback about using the API while doing real-world development, feel free to open a feature request in the issue tracker. If enough people give feedback about a certain aspect of the API, that could factor in to the final revision's design.
The accepted answer may have been correct at the time of writing, but as of 2/2018 the snippet part now includes a channelTitle property.

How to get a list of all retweeters in Twitter?

I have seen numerous companies doing like Twitter lotteries where users got to retweet their tweet and then one of retweeters will get the prize or whatever.
I was wondering now how do they get the list of all retweeters or pick the winner?
I checked Twitter API and found only this thing: GET statuses/retweets/:id but it returns maximum of 100 retweeters. Is that the only way?
It looks likes there's a couple services out there doing almost exactly this. A quick google pulls up http://onekontest.com/ and there's a few other Twitter contest services, but they all seem to be different levels of broken since they haven't kept up with changes to the API.
As far as the Twitter API itself is concerned, if you were expecting more than 100 responses, I think using GET statuses/mentions makes the most sense. That API call returns any mentions of a user, and you can pass the flag include_rts to include any retweets of your tweets. Then, if you wanted to list RTs of a specific tweet, you could check the in_reply_to_status_id field in the returned data to see if it matches the original tweet ID. This API call only returns the last 800 status, 200 at a time, so if you expect a bunch of data, you would need to poll the API repeatedly over time to get all the tweets. I imagine services like favstar are doing exactly this, just on a larger scale.
If you're actually looking for code to do something like this, I wrote a sinatra app called twitter-rss-digest which handles querying Twitter over time to track different sorts of queries. It's pretty rough, and doesn't quite handle this specifically, but it might point you in the right direction if you want to code something.
The Twitter API has an endpoint that returns up to 100 retweeter IDs for a given tweet.
Note that for historical reasons, that endpoint only returns up to 100 results and the documentation about the cursor is useless. Twitter refused to fix the situation.
2013 note
That said, the first thread on the Developers site that surfaced in a quick google has #episod, a Twitter employee saying:
You can't likely get to all of them. The data is spread out. Your best bet is to use the REST API to determine many of the users who performed the retweet, but the data will still be constrained.
It's easiest to track retweets as they happen rather than try to find them from the past. Use the Streaming API for that.
I like muffinista's method, but I think if you want a 100% complete list of retweets, simply enable the retweet email notifications and write a script that polls the email box for those matching the subject "retweeted one of your Tweets!" and put the data into a table. Do this right from the start.
The site https://twren.ch/ enlists all the retweeters for a given tweet (note that it only enlists retweeters who are direct followers of the source tweeter.) Nevertheless its probably the only public source available.

Retweets by a given user

I am trying to get a full list of a user's tweets. I do not particularly care what order they come in, but I need all of them, including what the user has ReTweeted. Essentially, I would like to have status/retweeted_by_me, but for specified user.
Is this at all possible?
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
Nope. Twitter's API leaves a lot to be desired (especially in terms of actual RESTfulness), but this particular issue is also my biggest gripe with it. You can only get your own retweets, but not the retweets of others. Look at any Desktop Twitter client, and compare a user's timeline in there with the actual timeline on the web. The latter contains all the retweets. This has been a big problem ever since they introduced the new retweets, and in my opinion is one of the reasons why acceptance of new-style RTs is slower than it could be among Twitter users. I've tried to make #twitterapi aware of the issue but never got a reply; maybe you (and anyone reading this) could do the same thing.
Their argument regarding BC is, of course, utter nonsense. It does not break BC at all, since these retweets never showed up in the first place. And even if they did, a ?retweets=true query argument would be enough to fix that. I really have no clue why they're not implementing this; their own website shows the retweets fine already, they just need to expose it in the API.

What is the number in a twitter status update URL?

My latest Twitter status update has the URL http://twitter.com/dinomite/status/1743967905 Does anyone know if there is any rhyme or reason behind the number 1743967905? It looks to me as though it might be a sequentially-assigned number for all Twitter users; I certainly haven't update 1.7b times, but all of Twitter might be around that. Anyone know?
According to the Twitter API docs it is the numerical ID of the status. I'd guess it's unique and sequential across all users, but I don't know for sure. If you need to know more take a look here for the official docs.
That would probably be the primary key in the status table. That URL format is used to look at a specific tweet.
Note that http://twitter.com/dinomite is the actual feed.
Also, based on how it seems to grow incrementally, this is probably an IDENTITY column or similar.
Yes, they're sequential.
One of the things it's helpful for is when writing a Twitter client, you can ask for anything newer than the last number you're already seen, so that you don't get and have to parse duplicates.

Resources