Get Trending Topics from Twitter

Jul 03, 2011

I recently had the need to get the trending topics on Twitter, and discovered it was really easy. Below is the code:

$url = "http://api.twitter.com/1/trends/1.json";
$data = json_decode(file_get_contents($url));
print_r($data);