Wednesday, October 27, 2010

Creating a feed of embedded videos in Drupal

Hi guys,

Its been a long time that i never had not posted over here about mu life...was a bit busy....so sorry for that... Today I ma going to share something that I learned while working with drupal to create a video feed... So here I goes.

Too create feeds of embedded third-party videos on Drupal sites using a combination of CCK, Embedded Media Field, media_youtube, FeedAPI, & the FeedAPI Element Mapper modules...

i am taking feeds from youtube hence using media_youtube. If you want use any other provider please download the required provider module from here.

  1. Enable the following modules and sub-modules: CCK, Embedded Media Field, Embedded Video Field, media_youtube, FeedAPI, FeedAPI Mapper, Common Syndication Parser or SimplePie Parser, FeedAPI Node. Make sure to give yourself the correct permissions in the access control admin page. Also refer Installation steps from the respective modules, especially feedapi module as it requires simplepie parser module as well.
  2. Create a content type (lets say video_item) that includes custom field (embedded video field). You can use FeedAPI Node's default content type, called feed, or (recommended) you can create your own (say video_feed) 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". 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!
Thats it. you are done... And now you can have a video feed in your drupal instance.

No comments:

Post a Comment