$feed = simplexml_load_file('http://www.google.com/trends/hottrends/atom/hourly');
$children = $feed->children('http://www.w3.org/2005/Atom');
$parts = $children->entry;
foreach ($parts as $entry) {
$details = $entry->children('http://www.w3.org/2005/Atom');
$dom = new domDocument();
@$dom->loadHTML($details->content);
$anchors = $dom->getElementsByTagName('a');
foreach ($anchors as $anchor) {
$url = $anchor->getAttribute('href');
$urltext = $anchor->nodeValue;
echo 'Link: ' . $urltext . ' ';
}
}
Showing posts with label google trends. Show all posts
Showing posts with label google trends. Show all posts
Wednesday, September 2, 2009
parsing the google trends atom feed rss
Subscribe to:
Posts (Atom)