function aggregator_aggregator_parse
aggregator_aggregator_parse($feed)
Implements hook_aggregator_parse().
File
- modules/aggregator/aggregator.parser.inc, line 21
- Parser functions for the aggregator module.
Code
function aggregator_aggregator_parse($feed) { global $channel, $image; // Filter the input data. if (aggregator_parse_feed($feed->source_string, $feed)) { $modified = empty($feed->http_headers['last-modified']) ? 0 : strtotime($feed->http_headers['last-modified']); // 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); } $etag = empty($feed->http_headers['etag']) ? '' : $feed->http_headers['etag']; // 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'] : ''; $feed->etag = $etag; $feed->modified = $modified; // Clear the cache. cache_clear_all(); return TRUE; } return FALSE; }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!aggregator!aggregator.parser.inc/function/aggregator_aggregator_parse/7.x