You are here

function hook_aggregator_fetch in Drupal 7

Create an alternative fetcher for aggregator.module.

A fetcher downloads feed data to a Drupal site. The fetcher is called at the first of the three aggregation stages: first, data is downloaded by the active fetcher; second, it is converted to a common format by the active parser; and finally, it is passed to all active processors, which manipulate or store the data.

Modules that define this hook can be set as the active fetcher within the configuration page. Only one fetcher can be active at a time.

Parameters

$feed: A feed object representing the resource to be downloaded. $feed->url contains the link to the feed. Download the data at the URL and expose it to other modules by attaching it to $feed->source_string.

Return value

TRUE if fetching was successful, FALSE otherwise.

See also

hook_aggregator_fetch_info()

hook_aggregator_parse()

hook_aggregator_process()

Related topics

1 function implements hook_aggregator_fetch()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

aggregator_aggregator_fetch in modules/aggregator/aggregator.fetcher.inc
Implements hook_aggregator_fetch().
2 invocations of hook_aggregator_fetch()
aggregator_admin_form in modules/aggregator/aggregator.admin.inc
Form constructor for the aggregator system settings.
aggregator_refresh in modules/aggregator/aggregator.module
Checks a news feed for new items.

File

modules/aggregator/aggregator.api.php, line 39
Documentation for aggregator API.

Code

function hook_aggregator_fetch($feed) {
  $feed->source_string = mymodule_fetch($feed->url);
}