How can I fetch tweets which contain a particular word?
For example : I want to fetch tweets from any user that contains “Bill Gates” as a part of their tweet.
How can it be done?
Any references to tutorials or good articles would be really great.
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.
It’s easier than you think. Examples:
So it’s the server http://search.twitter.com/ then the method search, then a dot and the format, json or atom, then the text you want to search for is the q parameter. Official documentation is here, and you can try them directly in your web browser to see the results — at least in Safari the JSON is shown unparsed and the ATOM is shown as a feed.
You can add additional filters (such as by geolocation or restricting yourself to certain languages) or perform other types of search (such as by user), as shown in the documentation.
To parse the result, you can throw the ATOM into the NSXMLParser and grab the parts you want or use the JSON with a third-party open source parser like json-framework or with whatever else you’ve got.