I wrote a processor that works, but there's some $ops that I'm confused on in the documentation:
1) The documentation shows the following for the 'default' $op in hook_nodeapi_item():
default:
if (function_exists('feedapi_node'. $op)) {
$args = array_slice(func_get_args(), 1);
return call_user_func_array('feedapi_node'. $op, $args);
}
I'm not sure what this is doing. Is this even needed?
2) The documentation shows the following for the 'type' $op in hook_nodeapi_item():
return array("XML feed");
Is the returned string arbitrary? What is it used for?
3) Finally, there is this:
case 'unique':
// Simplest is to make this return true so that we only have to implement the 'save' operation
// and not the 'update' operation.
return true;
Not sure what the idea is behind this either.
Thanks.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | 443436-5_api_doc.patch | 3.78 KB | aron novak |
| #2 | 443436_api_doc.patch | 3.31 KB | aron novak |
Comments
Comment #1
alex_b commented2)
Return the content type that your parser is going to produce or that your processor is going to consume. This is somewhat unused and I think we should remove content type negotiation altogether until we implement it for good.
3)
Feed API iterates through a feed on an item per item basis. First it will invoke your module to ask you whether the item at hand is unique (whether it is not already saved), if yes, it will later invoke hook_feedapi_node_feedapi_item with $op = 'save'. If no, it will invoke not invoke any further hooks on this item or - if a user has chosen to update existing items - it will invoke hook_feedapi_node_feedapi_item with $op == 'update'. The inconsistency in the usage of 'save' and 'update' is a known problem.
I think a full API documentation is needed.
Comment #2
aron novakComment #3
aron novakThis is such a patch what I would like to see in FeedAPI 1.9.
Comment #4
aron novakfeedapi_after_refresh() hook is missing.
Comment #5
aron novakUpdated.
FeedAPI main package does not use after_refresh hook, but FeedAPI data does, this is definitely a good reason to document it.
Comment #6
alex_b commentedGreat start. Needs some language cleanup.