Importing and synchronizing content using Feeds


Published on

Presentation from DrupalCamp Spain 2011 about Feeds in Drupal 7.

Published in: Technology
1 Comment
No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Importing and synchronizing content using Feeds

  1. 1. 7 drupalImporting and syncingcontent using FeedsPeter Vanhee2nd October 2011 - DrupalCamp Spain
  2. 2. Who am I?‣ Consumer and contributor to Drupal for over 5 years‣ Co-founder Youth Agora @youthagora and Nuvole @nuvoleweb‣ Web consultant in Barcelona @pvhee
  3. 3.
  4. 4. Content is aggregated and synchronized using Feeds
  5. 5. Use Cases‣ Build Activity streams using feeds from Twitter, Facebook, ...‣ Batch import sets of users from file‣ Import Commerce Products‣ ...
  6. 6. What is Feeds?
  7. 7. Feeds is...‣ Import / aggregate framework‣ Create and update drupal entities out of the box: nodes, users, taxonomy‣ Real-time feeds support
  8. 8. Related‣ Migrate ‣ Aggregator‣ Table Wizard‣ User import‣ Node import
  9. 9. Feeds as the standard for piping content
  10. 10. Feeds usage drupal 6 drupal 7 statistics from Statistics from
  11. 11. Fetcher ParserProcessor
  12. 12. Fetcher‣ Http‣ File upload A complete list is at
  13. 13. Parser‣ CSV, RSS1, RSS2, Atom‣ OPML, Sitemap XML‣ XPath for XML/HTML‣ JSONPath for JSON‣ YouTube, Flickr, Slideshare‣ iCal A complete list is at
  14. 14. Processor‣ Node‣ User‣ Taxonomy‣ Commerce Products A complete list is at
  15. 15. my drupal site Example #1Import and sync RSS Feeds
  16. 16. Feeds importers are configurations of Fetcher Parser Processor
  17. 17. create nodes of type Feed item
  18. 18. fields in RSS fields in Feed item
  19. 19. And now... importing!
  20. 20. /import
  21. 21. We can do this with Drupal Core Aggregator too!
  22. 22. Let’s try spawning Feed A User 1 Feed B Feed A User Feed B Feed C Feed C1 User 2 Feed X Aggregator (core) Feeds
  23. 23. Spawning
  24. 24. Add Feed = Add Node
  25. 25. Example #2Import images
  26. 26. A node of type Story will hold a Flickr image
  27. 27. the Flickr XML feed{
  28. 28. Parse XML with XPath expressions //item title link description geo:lat geo:longmedia:thumbnail/@url
  29. 29. Fetcher http Parser XPath Parser Map targets from XPathProcessor Node processor
  30. 30. select XPath XML parser
  31. 31. source is XPath Result fields in Story
  32. 32. Importing
  33. 33. We have problems ! Tags are not imported correctly
  34. 34. Feeds Tamper
  35. 35. Enter Tampering Input Field Output Field explodedrupal feeds sevilla drupal feeds sevilla html_encodeMe&lt;/a&gt;posted a <a href=”.”>Me</a> photo:&lt;/p&gt; posted a photo
  36. 36. Configure Tampering
  37. 37. More tamper actions
  38. 38. Add your own tamper plugins snippet from
  39. 39. After importing... tags are now correctly split
  40. 40. Importing Big Stuff‣ Feeds has Batch support‣ Feeds can run on cron jobs in the background
  41. 41. Field support‣ Text ‣ Email‣ File ‣ Multimedia‣ Image ‣ Address‣ Link‣ Geofield‣ Taxonomy Tip: check Feeds issue‣ Password queues for patches‣ Date‣ Integer
  42. 42. Feeds as a Framework‣ Supports import/sync of Commerce Products (via Commerce Feeds)‣ Straightforward to add custom fetchers, patchers and processors using Feed hooks (check feeds.api.php)
  43. 43. Finally...when not to use Feeds‣ Content does not need to be stored by Drupal‣ Complex content migration tasks
  44. 44. Now... Real-Time? Are we there yet? Are we there yet? Are we there yet?Publisher Subscriber Yes. Here you are. Are we there yet? Slide taken from @alexb presentation on Feeds
  45. 45. Enter PubSubHubBubPublisher Hub Subscriber What does this solve? 1. Notifications to Subscribers managed by Hub 2. Send only what is changed and when it gets changed
  46. 46. Euhm.. so what does Feeds do exactly? Feeds makes Drupal a PSHB SubscriberUpdate feeds in real-time from PSHB Hubs e.g. Blogger, Wordpress, Superfeedr, ...
  47. 47. Thanks! Peter Vanhee @pvhee
  48. 48. Questions? Peter Vanhee @pvhee