I'm importing an RSS feed from a sports website. Can I do any of the following:

  1. Ignore a feed item totally, if it contains a certain keyword (eg. "American football")
  2. Create an imported feed if a field contains a different keyword (eg. "Rugby football")
  3. Create a node, if an imported fields contains another keywords. (eg. "football")

If so, can an example, or a big hint be provided on how?

Comments

alex_b’s picture

Status: Active » Fixed

For these kinds of use cases I recommend creating your own custom processor plugin:

http://drupal.org/node/622700#pluginsapi

iantresman’s picture

Thanks for the pointer. Nice documentation.

hanno’s picture

I use the Rules module to define conditional actions.

I have a rule that only publishes the feed item when a field has a certain value, otherwise, the feed item stays unpublished. Works perfect during importing. You could also build conditional actions to create nodes.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

iantresman’s picture

Just for reference, there is a keyword filter for the older FeedAPI, see: FeedAPI Item Filter which includes a Keyword filter as standard. Hopefully it will be tweaked to work with Feeds.

Along the same lines, it would nice if there was also a taxonomy term filter which accept feed items if a category term was present, and set the appropriate term.

rbrownell’s picture

i disagree with the creation of a custom parcer, for most people the reason why people switch to drupal is to avoid working with large amounts of PHP code. For me, saying 'create your own parcer' is a challenge in which i spend at least a week on.

iantresman’s picture

If you could create your own parser without having to resort to PHP, it would keep everyone happy. eg. being able to select one of more fields, and compare them (equality, contains, less than, etc), with an option to use Regex, I think would cater to most.