In this section, we will see how to create a tool using PHP and Ajax that uses Twitter search API to retrieve the tweets from the user containing the searched for keyword. We will use Ajax, PHP, and Twitter API to make this tool.
You can call the Twitter search API as follows:
http://search.twitter.com/search.format?q=your_query_string
In the previous call, the format
can be replaced with json
or atom
. Furthermore, we can make a JSONP call with the extra callback
parameter.
http://search.twitter.com/search.format?q=your_query_string&callback=?
Let's suppose we want to search tweets with php in the search keyword and have the response in JSON format; then we can call the Twitter API like the Twitter API like this: