This is a little function I wrote in PHP to get all tweets from a certain location. The place you want to search around is defined by longitude and latitude, and then you tell the script how far around that point you would like to search in kilometres.

The script is very simple and fully commented. If you have any problems, please get in touch.


Initially, add the following line to your php file just before where you want to use it(making sure the twitter.php file is in the same directory):

include 'twitter.php';

Then, you can call the function by using;

getGeoTwitterFeed($long, $lat, $radius, $numberOfTweets )

Replacing $long, $lat, $radius and $numOfTweets with your parameters.