oEmbed (on rails)
Upcoming SlideShare
Loading in...5
×
 

oEmbed (on rails)

on

  • 1,157 views

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

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

Statistics

Views

Total Views
1,157
Views on SlideShare
1,142
Embed Views
15

Actions

Likes
0
Downloads
0
Comments
0

4 Embeds 15

https://www.xing.com 7
http://www.docseek.net 3
http://www.slashdocs.com 3
https://twitter.com 2

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

CC Attribution-ShareAlike LicenseCC Attribution-ShareAlike License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    oEmbed (on rails) oEmbed (on rails) Presentation Transcript

    • oEmbed on rails Kerstin Puschke Ruby Usergroup Hamburg January 2013K. Puschke (Ruby Usergroup HH) oembed January 2013 1 / 17
    • 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
    • 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) oembed January 2013 3 / 17
    • 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
    • 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
    • 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
    • third-party media embedding screenscraping is a maintenance nightmareK. Puschke (Ruby Usergroup HH) oembed January 2013 5 / 17
    • 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
    • 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
    • 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 January 2013 6 / 17
    • 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
    • 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
    • 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 January 2013 7 / 17
    • oEmbed providers youtube vimeo flickr twitter slideshare speakerdeckK. Puschke (Ruby Usergroup HH) oembed January 2013 7 / 17
    • oEmbed providers youtube vimeo flickr twitter slideshare speakerdeck intermediaries, e.g. embed.lyK. Puschke (Ruby Usergroup HH) oembed January 2013 7 / 17
    • 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 / 17
    • oEmbed consumers drupal wordpress elgg diaspora xingK. Puschke (Ruby Usergroup HH) oembed January 2013 8 / 17
    • oEmbed spec http GET request to API endpoint with query param urlK. Puschke (Ruby Usergroup HH) oembed January 2013 9 / 17
    • 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
    • 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
    • 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
    • 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
    • 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
    • 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 January 2013 12 / 17
    • 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
    • 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
    • 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
    • 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
    • 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
    • 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
    • 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
    • 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
    • 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
    • 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
    • oembed-provider-engineinner workings API endpoint routes to engine’s controller K. Puschke (Ruby Usergroup HH) oembed January 2013 15 / 17
    • 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
    • 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
    • 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
    • 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
    • oembed-provider-enginetodo still very rails 2-ish :-( needs polishing K. Puschke (Ruby Usergroup HH) oembed January 2013 16 / 17
    • oembed-provider-enginetodo still very rails 2-ish :-( needs polishing proper handling of authorization K. Puschke (Ruby Usergroup HH) oembed January 2013 16 / 17
    • 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
    • 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
    • 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
    • Feedback & CoQuestions, comments,. . . twitter: @titanoboa42K. Puschke (Ruby Usergroup HH) oembed January 2013 17 / 17
    • Feedback & CoQuestions, comments,. . . twitter: @titanoboa42 email: kerstin.puschke@xing.comK. Puschke (Ruby Usergroup HH) oembed January 2013 17 / 17
    • 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