I'm using the feed importer with the "Common syndication parser with term extraction". Upon fetching a feed, I have to manipulate the feed item. Feeds Tamper does this with string replacements but I have to do it with PHP code.
So my question is: Where (in which file, function,...) can I insert the code in order to change the feed item right after its creation and just before the term extraction?
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | feeds_tamper_full_item.patch | 1.07 KB | tekken |
Comments
Comment #1
tekken commentedUsing a PHP code evaluation plugin with Feeds Tamper looked like a possible solution. But the problem there is that at the stage where Feeds Tamper comes in, the feed item is not saved and $node is empty.
So I need to find the point right between saving the feed item and starting the term extraction at which I can insert my PHP code in Feeds. Any help is much appreciated!
Comment #2
nicolash commentedDon't really know about the term extraction, but if you need both the feed item AND the node object to be available, I think you will need to create your own mapper. The taxonomy one seems a good starting point (taxonomy.inc).
Comment #3
tekken commentedI worked around this by using the Feeds Tamper module with the earlier PHP code evaluation patch. Also simply changed the function
feeds_tamper_feeds_after_parsein the module to pass the full feed item as a parameter to plugins (see patch).Comment #4
twistor commentedThe full item can be accessed by $source->batch->items[$item_key]. We do it that way so that the item can be modified by reference as well as unset if needed.
Comment #5
zazinteractive commentedI want to do something similar but I couldn't find anything on how to use a feed item. I want to be able to change my link cck field after the node has been saved.
Comment #6
twistor commentedFeeds Tamper does not operate after a node has been saved. There are hooks for that.