Implements hook_aggregator_parse().
function aggregator_aggregator_parse($feed) {
global $channel, $image;
// Filter the input data.
if (aggregator_parse_feed($feed->source_string, $feed)) {
// Prepare the channel data.
foreach ($channel as $key => $value) {
$channel[$key] = trim($value);
}
// Prepare the image data (if any).
foreach ($image as $key => $value) {
$image[$key] = trim($value);
}
// Add parsed data to the feed object.
$feed->link = !empty($channel['link']) ? $channel['link'] : '';
$feed->description = !empty($channel['description']) ? $channel['description'] : '';
$feed->image = !empty($image['url']) ? $image['url'] : '';
// Clear the page and block caches.
cache_invalidate_tags(array(
'content' => TRUE,
));
return TRUE;
}
return FALSE;
}