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.

Comments

alex_b’s picture

Title: feedapi api documentation clarification, please » Create full API documentation
Version: 6.x-1.6 » 6.x-1.x-dev

2)

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.

aron novak’s picture

Status: Active » Needs review
StatusFileSize
new3.31 KB
aron novak’s picture

Priority: Normal » Critical

This is such a patch what I would like to see in FeedAPI 1.9.

aron novak’s picture

Status: Needs review » Needs work

feedapi_after_refresh() hook is missing.

aron novak’s picture

Status: Needs work » Needs review
StatusFileSize
new3.78 KB

Updated.
FeedAPI main package does not use after_refresh hook, but FeedAPI data does, this is definitely a good reason to document it.

alex_b’s picture

Assigned: Unassigned » alex_b
Status: Needs review » Needs work

Great start. Needs some language cleanup.