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?

CommentFileSizeAuthor
#3 feeds_tamper_full_item.patch1.07 KBtekken

Comments

tekken’s picture

Using 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!

nicolash’s picture

Don'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).

tekken’s picture

Project: Feeds » Feeds Tamper
Version: 6.x-1.0-beta10 » 6.x-1.0-beta2
StatusFileSize
new1.07 KB

I 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_parse in the module to pass the full feed item as a parameter to plugins (see patch).

twistor’s picture

The 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.

zazinteractive’s picture

I 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.

twistor’s picture

Status: Active » Closed (works as designed)

Feeds Tamper does not operate after a node has been saved. There are hooks for that.