Twitters new search feature is great for finding interesting people and topics to follow. So i wrote a script to get search results from twitter and display them on your site. This could be integrated into an existing application or used standalone to follow a particular topic or keyword on twitter,Â Check the Demo.
The script uses PHP and CURL to get the twitter search results to display them on the page. for the demo i’ve set an if statement to display results for ‘papermashup.com’ if no get variable is present.
Here’s the code that allows us to enter our search term, on submit it posts a get variable to the URL which PHP then processes with CURL.
So we use PHP, CURL, and the SimpleXMLElement() class in PHP5 to parse the XML file. Once we have the xml data, regular expression is used to find the links in the xml content element, which is then saved in $description.