oEmbed                                       on rails                                  Kerstin Puschke                    ...
LicenseCC BY-SA 3.0Creative CommonsAttribution ShareAlike 3.0http://creativecommons.org/licenses/by-sa/3.0/K. Puschke (Rub...
Who am I     software engineer at XINGK. Puschke (Ruby Usergroup HH)   oembed   January 2013   3 / 17
Who am I     software engineer at XING     perl and railsK. Puschke (Ruby Usergroup HH)   oembed   January 2013   3 / 17
Who am I     software engineer at XING     perl and rails     @titanoboa42 on twitterK. Puschke (Ruby Usergroup HH)   oemb...
Who am I     software engineer at XING     perl and rails     @titanoboa42 on twitter     titanoboa on githubK. Puschke (R...
Who am I     software engineer at XING     perl and rails     @titanoboa42 on twitter     titanoboa on github     titanobo...
third-party media embeddingAutomated third-party media embeddingturn a url into an embedded representation of the resource...
third-party media embedding     screenscraping is a maintenance nightmareK. Puschke (Ruby Usergroup HH)   oembed          ...
third-party media embedding     screenscraping is a maintenance nightmare     provider specific APIs:     additional effort...
third-party media embedding     screenscraping is a maintenance nightmare     provider specific APIs:     additional effort...
oEmbed     open embed formatK. Puschke (Ruby Usergroup HH)   oembed   January 2013   6 / 17
oEmbed     open embed format     open web standard for third-party media embeddingK. Puschke (Ruby Usergroup HH)   oembed ...
oEmbed     open embed format     open web standard for third-party media embedding     specs published in 2008K. Puschke (...
oEmbed     open embed format     open web standard for third-party media embedding     specs published in 2008     by Leah...
oEmbed providers     youtubeK. Puschke (Ruby Usergroup HH)   oembed   January 2013   7 / 17
oEmbed providers     youtube     vimeoK. Puschke (Ruby Usergroup HH)   oembed   January 2013   7 / 17
oEmbed providers     youtube     vimeo     flickrK. Puschke (Ruby Usergroup HH)   oembed   January 2013   7 / 17
oEmbed providers     youtube     vimeo     flickr     twitterK. Puschke (Ruby Usergroup HH)   oembed   January 2013   7 / 17
oEmbed providers     youtube     vimeo     flickr     twitter     slideshareK. Puschke (Ruby Usergroup HH)   oembed   Janua...
oEmbed providers     youtube     vimeo     flickr     twitter     slideshare     speakerdeckK. Puschke (Ruby Usergroup HH) ...
oEmbed providers     youtube     vimeo     flickr     twitter     slideshare     speakerdeck     intermediaries, e.g. embed...
oEmbed consumers     drupalK. Puschke (Ruby Usergroup HH)   oembed   January 2013   8 / 17
oEmbed consumers     drupal     wordpressK. Puschke (Ruby Usergroup HH)   oembed   January 2013   8 / 17
oEmbed consumers     drupal     wordpress     elggK. Puschke (Ruby Usergroup HH)   oembed   January 2013   8 / 17
oEmbed consumers     drupal     wordpress     elgg     diasporaK. Puschke (Ruby Usergroup HH)   oembed   January 2013   8 ...
oEmbed consumers     drupal     wordpress     elgg     diaspora     xingK. Puschke (Ruby Usergroup HH)   oembed   January ...
oEmbed spec     http GET request to API endpoint with query param urlK. Puschke (Ruby Usergroup HH)   oembed              ...
oEmbed spec     http GET request to API endpoint with query param url     optional additional params: maxwidth, maxheight,...
oEmbed spec     http GET request to API endpoint with query param url     optional additional params: maxwidth, maxheight,...
oEmbed spec     http GET request to API endpoint with query param url     optional additional params: maxwidth, maxheight,...
Example: videohttp://www.youtube.com/oembed?url=http://www.youtube.com/watch?v=zwk1KvnZxGw{       "author_name": "XINGcom"...
Example response: photo{      "type": "photo",       "title": "Ba...       "author_name": "...       "author_url": "http:/...
oEmbed gems     quite a few consumer gemsK. Puschke (Ruby Usergroup HH)   oembed   January 2013   12 / 17
oEmbed gems     quite a few consumer gems     oembed-provider (rails 2 only)K. Puschke (Ruby Usergroup HH)   oembed   Janu...
oEmbed gems     quite a few consumer gems     oembed-provider (rails 2 only)     oembed-provider-engine (rails 3 only)    ...
oembed-provider-engineturning your app into an oEmbed provider      mount OembedProviderEngine::Engine in routes.rb      t...
oembed-provider-engineturning your app into an oEmbed provider      mount OembedProviderEngine::Engine in routes.rb      t...
oembed-provider-engineturning your app into an oEmbed provider      mount OembedProviderEngine::Engine in routes.rb      t...
oembed-provider-engineturning your app into an oEmbed provider      mount OembedProviderEngine::Engine in routes.rb      t...
oembed-provider-engineturning your app into an oEmbed provider      mount OembedProviderEngine::Engine in routes.rb      t...
oembed-provider-engineinner workings      oembed_providable_as creates scoped OembedResponse      model, e.g. MediaItem::O...
oembed-provider-engineinner workings      oembed_providable_as creates scoped OembedResponse      model, e.g. MediaItem::O...
oembed-provider-engineinner workings      oembed_providable_as creates scoped OembedResponse      model, e.g. MediaItem::O...
oembed-provider-engineinner workings      oembed_providable_as creates scoped OembedResponse      model, e.g. MediaItem::O...
oembed-provider-engineinner workings      API endpoint routes to engine’s controller K. Puschke (Ruby Usergroup HH)    oem...
oembed-provider-engineinner workings      API endpoint routes to engine’s controller      param url parsed to determine me...
oembed-provider-engineinner workings      API endpoint routes to engine’s controller      param url parsed to determine me...
oembed-provider-engineinner workings      API endpoint routes to engine’s controller      param url parsed to determine me...
oembed-provider-engineinner workings      API endpoint routes to engine’s controller      param url parsed to determine me...
oembed-provider-enginetodo       still very rails 2-ish :-( needs polishing K. Puschke (Ruby Usergroup HH)       oembed   ...
oembed-provider-enginetodo       still very rails 2-ish :-( needs polishing       proper handling of authorization K. Pusc...
oembed-provider-enginetodo       still very rails 2-ish :-( needs polishing       proper handling of authorization       c...
oembed-provider-enginetodo       still very rails 2-ish :-( needs polishing       proper handling of authorization       c...
oembed-provider-enginetodo       still very rails 2-ish :-( needs polishing       proper handling of authorization       c...
Feedback & CoQuestions, comments,. . .     twitter: @titanoboa42K. Puschke (Ruby Usergroup HH)   oembed   January 2013   1...
Feedback & CoQuestions, comments,. . .     twitter: @titanoboa42     email: kerstin.puschke@xing.comK. Puschke (Ruby Userg...
Feedback & CoQuestions, comments,. . .     twitter: @titanoboa42     email: kerstin.puschke@xing.com     github: https://g...
Upcoming SlideShare
Loading in …5
×

oEmbed (on rails)

1,717 views
1,592 views

Published on

short introductory talk about oembed and how to turn a rails app into an oembed provider. ruby usergroup hamurg, 2013

Published in: Travel
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,717
On SlideShare
0
From Embeds
0
Number of Embeds
20
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

oEmbed (on rails)

  1. 1. oEmbed on rails Kerstin Puschke Ruby Usergroup Hamburg January 2013K. Puschke (Ruby Usergroup HH) oembed January 2013 1 / 17
  2. 2. LicenseCC BY-SA 3.0Creative CommonsAttribution ShareAlike 3.0http://creativecommons.org/licenses/by-sa/3.0/K. Puschke (Ruby Usergroup HH) oembed January 2013 2 / 17
  3. 3. Who am I software engineer at XINGK. Puschke (Ruby Usergroup HH) oembed January 2013 3 / 17
  4. 4. Who am I software engineer at XING perl and railsK. Puschke (Ruby Usergroup HH) oembed January 2013 3 / 17
  5. 5. Who am I software engineer at XING perl and rails @titanoboa42 on twitterK. Puschke (Ruby Usergroup HH) oembed January 2013 3 / 17
  6. 6. Who am I software engineer at XING perl and rails @titanoboa42 on twitter titanoboa on githubK. Puschke (Ruby Usergroup HH) oembed January 2013 3 / 17
  7. 7. Who am I software engineer at XING perl and rails @titanoboa42 on twitter titanoboa on github titanoboa on stackoverflowK. Puschke (Ruby Usergroup HH) oembed January 2013 3 / 17
  8. 8. third-party media embeddingAutomated third-party media embeddingturn a url into an embedded representation of the resourcee.g. magically display embedded video instead of linkK. Puschke (Ruby Usergroup HH) oembed January 2013 4 / 17
  9. 9. third-party media embedding screenscraping is a maintenance nightmareK. Puschke (Ruby Usergroup HH) oembed January 2013 5 / 17
  10. 10. third-party media embedding screenscraping is a maintenance nightmare provider specific APIs: additional effort for each additional providerK. Puschke (Ruby Usergroup HH) oembed January 2013 5 / 17
  11. 11. third-party media embedding screenscraping is a maintenance nightmare provider specific APIs: additional effort for each additional provider oEmbed standardizes embeddingK. Puschke (Ruby Usergroup HH) oembed January 2013 5 / 17
  12. 12. oEmbed open embed formatK. Puschke (Ruby Usergroup HH) oembed January 2013 6 / 17
  13. 13. oEmbed open embed format open web standard for third-party media embeddingK. Puschke (Ruby Usergroup HH) oembed January 2013 6 / 17
  14. 14. oEmbed open embed format open web standard for third-party media embedding specs published in 2008K. Puschke (Ruby Usergroup HH) oembed January 2013 6 / 17
  15. 15. oEmbed open embed format open web standard for third-party media embedding specs published in 2008 by Leah Culver (Pownce), Cal Henderson (Flickr), Mike Malone (Pownce), and Richard Crowley (OpenDNS)K. Puschke (Ruby Usergroup HH) oembed January 2013 6 / 17
  16. 16. oEmbed providers youtubeK. Puschke (Ruby Usergroup HH) oembed January 2013 7 / 17
  17. 17. oEmbed providers youtube vimeoK. Puschke (Ruby Usergroup HH) oembed January 2013 7 / 17
  18. 18. oEmbed providers youtube vimeo flickrK. Puschke (Ruby Usergroup HH) oembed January 2013 7 / 17
  19. 19. oEmbed providers youtube vimeo flickr twitterK. Puschke (Ruby Usergroup HH) oembed January 2013 7 / 17
  20. 20. oEmbed providers youtube vimeo flickr twitter slideshareK. Puschke (Ruby Usergroup HH) oembed January 2013 7 / 17
  21. 21. oEmbed providers youtube vimeo flickr twitter slideshare speakerdeckK. Puschke (Ruby Usergroup HH) oembed January 2013 7 / 17
  22. 22. oEmbed providers youtube vimeo flickr twitter slideshare speakerdeck intermediaries, e.g. embed.lyK. Puschke (Ruby Usergroup HH) oembed January 2013 7 / 17
  23. 23. oEmbed consumers drupalK. Puschke (Ruby Usergroup HH) oembed January 2013 8 / 17
  24. 24. oEmbed consumers drupal wordpressK. Puschke (Ruby Usergroup HH) oembed January 2013 8 / 17
  25. 25. oEmbed consumers drupal wordpress elggK. Puschke (Ruby Usergroup HH) oembed January 2013 8 / 17
  26. 26. oEmbed consumers drupal wordpress elgg diasporaK. Puschke (Ruby Usergroup HH) oembed January 2013 8 / 17
  27. 27. oEmbed consumers drupal wordpress elgg diaspora xingK. Puschke (Ruby Usergroup HH) oembed January 2013 8 / 17
  28. 28. oEmbed spec http GET request to API endpoint with query param urlK. Puschke (Ruby Usergroup HH) oembed January 2013 9 / 17
  29. 29. oEmbed spec http GET request to API endpoint with query param url optional additional params: maxwidth, maxheight, formatK. Puschke (Ruby Usergroup HH) oembed January 2013 9 / 17
  30. 30. oEmbed spec http GET request to API endpoint with query param url optional additional params: maxwidth, maxheight, format response format xml or jsonK. Puschke (Ruby Usergroup HH) oembed January 2013 9 / 17
  31. 31. oEmbed spec http GET request to API endpoint with query param url optional additional params: maxwidth, maxheight, format response format xml or json informs consumer how to embed, e.g. gives html snippetK. Puschke (Ruby Usergroup HH) oembed January 2013 9 / 17
  32. 32. Example: videohttp://www.youtube.com/oembed?url=http://www.youtube.com/watch?v=zwk1KvnZxGw{ "author_name": "XINGcom", "html": "<iframe width="480" height="270" src= "version": "1.0", "author_url": "http://www.youtube.com/user/XING... "thumbnail_width": 480, "height": 270, "provider_url": "http://www.youtube.com/", "type": "video", "width": 480, "thumbnail_height": 360, "thumbnail_url": "http://i3.ytimg.com/vi/... "provider_name": "YouTube", "title": "Was ist XING?"}K. Puschke (Ruby Usergroup HH) oembed January 2013 10 / 17
  33. 33. Example response: photo{ "type": "photo", "title": "Ba... "author_name": "... "author_url": "http://www.flickr.com/photos/... "width": "1024", "height": "768", "url": "http://farm4.staticflickr.com/3040/2362... "web_page": "http://www.flickr.com/photos/be... "thumbnail_url": "http://farm4.staticfli... "thumbnail_width": 75, "thumbnail_height": 75, "web_page_short_url": "http://flic.kr/p/4... "license": "All Rights Reserved", "version": "1.0", "cache_age": 3600, "provider_name": "Flickr",K. Puschke (Ruby Usergroup HH) oembed January 2013 11 / 17
  34. 34. oEmbed gems quite a few consumer gemsK. Puschke (Ruby Usergroup HH) oembed January 2013 12 / 17
  35. 35. oEmbed gems quite a few consumer gems oembed-provider (rails 2 only)K. Puschke (Ruby Usergroup HH) oembed January 2013 12 / 17
  36. 36. oEmbed gems quite a few consumer gems oembed-provider (rails 2 only) oembed-provider-engine (rails 3 only) mountable rails 3 engine, heavily based on oembed-providerK. Puschke (Ruby Usergroup HH) oembed January 2013 12 / 17
  37. 37. oembed-provider-engineturning your app into an oEmbed provider mount OembedProviderEngine::Engine in routes.rb to provide route to API endpoint K. Puschke (Ruby Usergroup HH) oembed January 2013 13 / 17
  38. 38. oembed-provider-engineturning your app into an oEmbed provider mount OembedProviderEngine::Engine in routes.rb to provide route to API endpoint your media item’s model K. Puschke (Ruby Usergroup HH) oembed January 2013 13 / 17
  39. 39. oembed-provider-engineturning your app into an oEmbed provider mount OembedProviderEngine::Engine in routes.rb to provide route to API endpoint your media item’s model needs a method for each field to be part of the oEmbed response, e.g. html, thumbnail_url,. . . K. Puschke (Ruby Usergroup HH) oembed January 2013 13 / 17
  40. 40. oembed-provider-engineturning your app into an oEmbed provider mount OembedProviderEngine::Engine in routes.rb to provide route to API endpoint your media item’s model needs a method for each field to be part of the oEmbed response, e.g. html, thumbnail_url,. . . include OembedProviderEngine::OembedProvidable K. Puschke (Ruby Usergroup HH) oembed January 2013 13 / 17
  41. 41. oembed-provider-engineturning your app into an oEmbed provider mount OembedProviderEngine::Engine in routes.rb to provide route to API endpoint your media item’s model needs a method for each field to be part of the oEmbed response, e.g. html, thumbnail_url,. . . include OembedProviderEngine::OembedProvidable call oembed_providable_as with media type, e.g. oembed_providable_as :video K. Puschke (Ruby Usergroup HH) oembed January 2013 13 / 17
  42. 42. oembed-provider-engineinner workings oembed_providable_as creates scoped OembedResponse model, e.g. MediaItem::OembedResponse K. Puschke (Ruby Usergroup HH) oembed January 2013 14 / 17
  43. 43. oembed-provider-engineinner workings oembed_providable_as creates scoped OembedResponse model, e.g. MediaItem::OembedResponse response model has attributes for each field to be included into the response K. Puschke (Ruby Usergroup HH) oembed January 2013 14 / 17
  44. 44. oembed-provider-engineinner workings oembed_providable_as creates scoped OembedResponse model, e.g. MediaItem::OembedResponse response model has attributes for each field to be included into the response its initializer sets attributes to the respective values from the app’s media item K. Puschke (Ruby Usergroup HH) oembed January 2013 14 / 17
  45. 45. oembed-provider-engineinner workings oembed_providable_as creates scoped OembedResponse model, e.g. MediaItem::OembedResponse response model has attributes for each field to be included into the response its initializer sets attributes to the respective values from the app’s media item has methods to format the response K. Puschke (Ruby Usergroup HH) oembed January 2013 14 / 17
  46. 46. oembed-provider-engineinner workings API endpoint routes to engine’s controller K. Puschke (Ruby Usergroup HH) oembed January 2013 15 / 17
  47. 47. oembed-provider-engineinner workings API endpoint routes to engine’s controller param url parsed to determine media item model K. Puschke (Ruby Usergroup HH) oembed January 2013 15 / 17
  48. 48. oembed-provider-engineinner workings API endpoint routes to engine’s controller param url parsed to determine media item model media item object initialized scoped response model created (if not already existing) K. Puschke (Ruby Usergroup HH) oembed January 2013 15 / 17
  49. 49. oembed-provider-engineinner workings API endpoint routes to engine’s controller param url parsed to determine media item model media item object initialized scoped response model created (if not already existing) response object initialized K. Puschke (Ruby Usergroup HH) oembed January 2013 15 / 17
  50. 50. oembed-provider-engineinner workings API endpoint routes to engine’s controller param url parsed to determine media item model media item object initialized scoped response model created (if not already existing) response object initialized response formatted and returned K. Puschke (Ruby Usergroup HH) oembed January 2013 15 / 17
  51. 51. oembed-provider-enginetodo still very rails 2-ish :-( needs polishing K. Puschke (Ruby Usergroup HH) oembed January 2013 16 / 17
  52. 52. oembed-provider-enginetodo still very rails 2-ish :-( needs polishing proper handling of authorization K. Puschke (Ruby Usergroup HH) oembed January 2013 16 / 17
  53. 53. oembed-provider-enginetodo still very rails 2-ish :-( needs polishing proper handling of authorization caching K. Puschke (Ruby Usergroup HH) oembed January 2013 16 / 17
  54. 54. oembed-provider-enginetodo still very rails 2-ish :-( needs polishing proper handling of authorization caching improve test coverage, maybe migrate from shoulda to rspec K. Puschke (Ruby Usergroup HH) oembed January 2013 16 / 17
  55. 55. oembed-provider-enginetodo still very rails 2-ish :-( needs polishing proper handling of authorization caching improve test coverage, maybe migrate from shoulda to rspec allow for custom fields to be added to the response K. Puschke (Ruby Usergroup HH) oembed January 2013 16 / 17
  56. 56. Feedback & CoQuestions, comments,. . . twitter: @titanoboa42K. Puschke (Ruby Usergroup HH) oembed January 2013 17 / 17
  57. 57. Feedback & CoQuestions, comments,. . . twitter: @titanoboa42 email: kerstin.puschke@xing.comK. Puschke (Ruby Usergroup HH) oembed January 2013 17 / 17
  58. 58. Feedback & CoQuestions, comments,. . . twitter: @titanoboa42 email: kerstin.puschke@xing.com github: https://github.com/xing/oembed_provider_engine . . . we are happy to accept pull requestsK. Puschke (Ruby Usergroup HH) oembed January 2013 17 / 17

×