Development Seed

Blog

Pick It Off the Feed, Stick It on the Node: Part 2

Use the Feed Element Mapper to Map Any RSS Tag to Taxonomy or CCK Fields

The first time I talked here about the Feed Element Mapper, it was still quite basic - it just mapped feed elements recognized by FeedAPI to taxonomy terms. That was already pretty cool, but what about mapping to CCK fields, and what about mapping any tag - even custom ones - to CCK fields? 

Well, the latest developer version of FeedAPI (Jan 23rd), together with Feed Element Mapper 1.0 beta 3, can do this. It offers a straight forward form manageable also for the not so experienced site builder. I recorded this screencast to show you how this plays out on the UI:

If you would like to try this, take care that you do the following:

  • Use FeedAPI 1.0
  • Use Feed Element Mapper >= 1.0 beta 3
  • Configure your feeds to use parser_simplepie as parser.

Could these modules be used

Could these modules be used to pull down a feed through an http request, auto populate content from the result (which is xml) and build an a comparison shopping site (amazon, ebay etc), listing products, prices, stores etc?

I can see by your example how easy it is to import but what if the content from the http request (xml file) changes? Could/would it update the related nodes and taxonomies?

I am sure some customization would have to take place but it seems these modules can do a bulk of the work (mapping).

Thanks

Hi Elvis, Continuous

Hi Elvis,

Continuous updating on cron time is possible with FeedAPI + Feed Element Mapper.

Alex

Yup. Sweet and feedtastic.

This is great work. I'm looking forward to updating a couple test sites and seeing what can be done.

Cheers,

Bill

Mapping rules for domains?

I'm wondering if it trivial, possible or whatever, to have a set of predefined mapping rules?

For example, I have a project where I would ideally like to have people enter an id for a website, and get feed items using just the id. Obviously, if this are all coming from the same website, the feed's xml format is constant - therefore, it would be advantageous to be able to "map" the domain (via a url regexp or something) to a predefined rule for that particular type of feed.

After that, no further mapping of elements would be required throughout the site (for this domain)!

Thoughts?

You can't define rules per

You can't define rules per domain, but you can define rules per content type. So you could e. g. set up a content type for this domain.

Unfortunately per content type rules don't yet support special feed tags.

Ok :)

Not possible *at the moment*, but I'm thinking that an admin only interface could be implemented quite easily? Not sure of the technicalities. I'm thinking of matching a user-added feed to a set of mapping rules via a comparison on the url?

Yeah, and that's the tricky

Yeah, and that's the tricky part: On a content type edit page, we need an elegant solution that allows the user to define the custom feed element she would like to map from - scratching my head - this might be just a slot for a URL with a submit button and some help text, indeed.

Tasty!

Wow this would have saved me a lot of code about 6 months ago. It would be great if this could continue to be extended to handle things like multiple-value cck fields, nodereferences, imagefields, etc.

Mmmmm. Maptastic. Timely too

Mmmmm. Maptastic. Timely too - we'll probably be using this for an upcoming project...

Thanks Alex!