modules/aggregator/aggregator.api.php, 102行
实现这个钩子可以为聚合模块创建一个替代解析器.
A parser converts feed item data to a common format. The parser is called at the second of the three aggregation stages: data is downloaded by the active fetcher, 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 active parser on admin/content/aggregator/settings. Only one parser can be active at a time.
By convention, the common format for a single feed item is: $item[key-name] = value;
Recognized keys: TITLE (string) - the title of a feed item DESCRIPTION (string) - the description (body text) of a feed item TIMESTAMP (UNIX timestamp) - the feed item's published time as UNIX timestamp AUTHOR (string) - the feed item's author GUID (string) - RSS/Atom global unique identifier LINK (string) - the feed item's URL
@see hook_aggregator_fetch()
$feed The $feed object that describes the resource to be parsed. $feed->source_string contains the raw feed data as a string. Parse data from $feed->source_string and expose it to other modules as an array of data items on $feed->items.
<?php function hook_aggregator_parse($feed) { $feed->items = mymodule_parse($feed->source_string); } ?>
1 周 6 天之前
3 周 4 天之前
3 周 4 天之前
3 周 4 天之前
5 周 3 天之前
5 周 3 天之前
7 周 3 天之前
7 周 3 天之前
7 周 3 天之前
7 周 3 天之前