I am writing a feedapi processor which will run before the node_processor to import feed items as nodes.
I've got it all set up and firing properly on each action on the feed node.
I basically want to 'drop' an item in the feed if a certain condition is met, for example, if tag = foo.
I've managed to catch the condition in my processor, but when i set $feed_item = new stdClass(); or $feed_item = null; to delete the feed_item when node processor then runs after my custom processor it still imports all the feed items.
how can i 'exclude' these feed_items or delete them from getting added in the node_processor.
my module is setup correctly and my processor is definitely firing before node_processor.
heres my code -
function module_feedapi_save($feed_item, $feed_nid, $settings){
switch($feed_item->options->tags['0']{
case 'tag':
$feed_item = null;
return $feed_item;
}
}
i could explicitely call _feedapi_node_save(); from within my module, after i unset the feed_item, but this doesnt seem like the best way to approach things, since if i do this, i will have to disable it on the content type, and my custom module will need to fire off all the feedapi_node modules nodeapi hooks.
any ideas?
Comments
Comment #1
aron novakWell, by design feedapi calls processors totally separately. So at the moment there is no nice way to do that, only if you write a parser (a wrapper of an existing parser) for this purpose.
Comment #2
tayzlor commentedthanks for the quick reply Aron,
would you recommend writing a parser (for example a wrapper for simplepie) rather than my own processor, which then fire's off node_processor calls to save the nodes instead?
Comment #3
tayzlor commented@Aron
nvm, managed to write a wrapper for the simplepie_module which achieves what i need.
it would be great if you could write processors which ran one after another an allowed you to pass the feed 'state' between each though, so you could add to the feed, remove items, etc.. and it would be passed down the line.
Comment #4
aron novakit seems that the original problem was solved
eparser is a possible way to go, i think