Module Mashup: Creating a feed of embedded videos using emfield, feedapi, and feedapi_mapper

Apr 13, 2008

The following is a HOWTO I just submitted to the Drupal.org Handbook

It is now easy to create feeds of embedded third-party videos on Drupal sites using a combination of CCK, Embedded Media Field, FeedAPI, & the FeedAPI Element Mapper modules.

  1. Enable the following modules and sub-modules: CCK, Embedded Media Field, Embedded Video Field, FeedAPI, FeedAPI Mapper, Common Syndication Parser or SimplePie Parser, FeedAPI Node, & (if you plan on using views with your feeds) FeedAPI Node Views. Make sure to give yourself the correct permissions in the access control admin page.
  2. Create a content type that includes an embedded video field. Once you add the field in is suggested that you select "thumbnail" or "thumbnail with thickbox" to avoid loading too many videos on pages with teaser lists. You can use FeedAPI Node's default content type, called feed, or you can create your own and designate it as a feed in the content type settings page.
  3. Under admin/settings/feedapi it is suggested that you remove object and embed tags from the allowed list, as these may cause problems with certain providers.
  4. Create a feed at node/add/feedapi-node (if you are using the default feedapi node). Give the feed a name, you can leave body blank (the field will fill this by default), and enter in the address of the field in the "feed" field. Make sure that "Refresh feed on creation" is unchecked, then click on "Processors". In thedrop-down menu under "Node type of feed items:" select the content type for embedded videos that you created in step 2, then submit the node.
  5. On the page of the feedapi node you created select the "Map" tab, next to "Edit" (it should take a few moments to load).
  6. On the mapping page expand the form item labled "Feed item example" and look for the original URL of the example video (i.e. the url as you would normally paste it into an embedded video field); for most video providers this will be "options->original_url", though Google Videos currently maps to "options->raw->guid". Under "Edit mapping" find the item that matches the url and select to map it to the embedded video field (you can also map items to taxonomies or other fields if you like and have it set up). Press "Update".
  7. After you are redirected back to the feedapi node click on "Refresh", which should populate your feed. Click on "Feed Items", and you should now see a feed of videos!

Notes:

  • in order to use the thickbox thumbnails you must also use the thickbox module and patch it as described here.
  • this method creates nodes from the feed items, so please keep in mind that this could create a good deal of nodes on your site in a short amount of time.

Projects Inquiry

Let's talk!

Tell us how we can help you with your project