Removing bot tweets when using Twitter API - twitter

Is there a way to remove bot tweets (or at least minimize it) when using Twitter API ?
Especially, I would like to know if it is possible to do that from the query.
But, I am open to any kind of solution.
My research :
I found that adding -is:nullcast -bio:bot -bio_name:bot -bio_location:bot -bio:TwitterBot -bio_name:TwitterBot -bio_location:TwitterBot at the end of a query minimize the amount of bot tweets received. But I still have a lot of bot tweets.

Related

Is there any methods to get the like list of a tweet?

I want to get the complete like list of a specific tweet, but the Twitter API only provided an API that can retrieve the 100 most recent users who liked the specific tweet. I also looked for Twitter crawlers on Github, but they all worked in a user-oriented manner, ie they can only get a list of liked tweets of a user, not a list of liking users of a specific tweet.
I also tried to crawl the list using selenium, but maybe due to my limited skill, it didn't work well. I don't want to spend a lot of time studying selenium and front-end knowledge just to accomplish a simple thing, so are there any open source codes or twitter APIs that can do this?
Yes. This has just been announced in the Twitter API v2.
Previously, you were limited to the 100 most recent Likes or Retweets with these endpoints. We heard your feedback that this was too limiting and have updated these endpoints to now return all results. To retrieve a complete list of Likes and Retweets, you can now use pagination.
Use the v2 Likes lookup endpoint: GET /2/tweets/:id/liking_users

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

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

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 do I get the retweet_count of a given tweet WITHOUT user interaction?

I have a list of tweets that are using a hashtag I made. I'm getting these tweets using the search api. All I want is to get the number of retweets. I DO NOT need to post on their behalf. It seams ridiculous that I would need to have every single user login to my site, login to twitter and approve my application via OAUTH for EVERY TWEET IN MY LIST. There's gotta be a way to get that number without the need for oauth.
I tried getting it directly from the search api, but that's not consistently there. I've tried https://api.twitter.com/1/statuses/show/275729088709283840.json but that doesn't work, for some reason. Is there anyway to do this extremely simple task without going down the asinine road of user-interaction?
You have to create a background-process that uses the stream API. Phirehose is a php library that is set up to do this: https://github.com/fennb/phirehose

How does the "Sneak peak" Twitter account work?

So I came across this Twitter account while I was wasting time on Failblog. I became very intrigued by it. The way it works is this person tweets 'I think you mean "sneak peek"' whenever someone tweets something with the string "sneak peak" in it. And it is automated as I discovered by tweeting "Sneak peak" myself, and getting a response within seconds:
So my question is, how is this done?
Can you get notifications somehow when someone tweets something containing a certain string? Consider that this already happens when someone tweets your username, so it is technically possible.
Or does this person have a computer running all the time that searches twitter every few seconds for the string?
Or are both possible?
This almost certainly uses the Twitter Streaming API.
The set of streaming APIs offered by Twitter give developers low latency access to Twitter's global stream of Tweet data. A proper implementation of a streaming client will be pushed messages indicating Tweets and other events have occurred, without any of the overhead associated with polling a REST endpoint.
So, there is a server somewhere which is continually streaming the Twitter API, filtered for the specific term.
Whenever the server sees a new tweet come through the stream, it tweets the response automatically.
So, to answer your questions:
1) Yes.
2) Yes, but it's not constantly polling, it's receiving the data automatically.
Not sure about 1), but 2) is easily manageable using the search API :
http://search.twitter.com/search.atom?q=sneak%20peak will get you the recent tweets containing 'sneak peak'. (including the time of the tweet)
Then the program can answer to those people, and keeping the time of the tweet in order to not tweet to people which the program has already tweeted to.

Resources