<?php
/**
* @file
* Describe the planned API functions for aggregator module (D7).
*/
/**
* The parsers have to implement this hook.
*
* @param $url
* The URL of the feed. Can be non-HTTP URLs too.
*/
function hook_parse($url) {
}
/**
* The processors have to implement this hook.
*
* @param $op
* 'save' or 'delete'
* 'save' also behaves as 'update'
* @param $items
* When 'save', array of parsed items.
* When 'delete', array of item IDs.
*/
function hook_process($op, $items) {
}
/**
* Downloads the given feed, if changed, call the parsers, cache the parser result, call the processors.
*
* @param $feeds
* array of nid's of the feeds.
*/
function aggregator_feed_refresh($feeds) {
}
/**
* Builds and initializes a feed object.
* It does not download the feed. it just creates the basic structure
*
* @param $url
* The URL of the feed.
* @param $type
* The content-type of the feed node, this determines the feed configuration.
* @return
* The node-feed object
*/
function aggregator_feed_create($url, $type) {
}
/**
* Downloads and parses the feed. populates $feed object and add the items to it.
* Also it caches the parsed results. But it does not save the feed nor the items.
*
* @param $feed
* The node-feed object (come from aggregator_feed_create).
*/
function aggregator_feed_retrieve($feed) {
}
/**
* Show the feed to the user.
* The $feed can be with or without feed items.
* A possible use-case: $output = theme('aggregator_feed_preview', $feed);
*
* @param $feed
* The node-feed object
*
*/
function theme_aggregator_feed_preview($feed) {
}
/**
* Save the feed object, it becomes a node and metadata about the feed.
* If the node-feed contains the items, the processors are called to save them.
*
* @param $feed
* The node-feed object with our without the items.
*/
function aggregator_feed_save($feed) {
}
/**
* List all the feeds essential information.
*
* @param $type
* Filter the listing by node type.
* @return
* array ('nid' => array('url' => , 'title' => , 'description' => )
*/
function aggregator_feed_list($type = FALSE) {
}
/**
* Downloads a HTTP url. It handles redirections (only HTTP), feed autodetection,
* If-Modified-Since and If-None-Match
*
* @param $url
* Absolute HTTP URL
*/
function aggregator_download($url) {
}
/**
* For loading a feed fully, use node_load().
*/
/**
* For deleting a feed, use node_delete().
* It won't delete feed items. Arguments for this: performance and linkrot.
*/