Skip to content

Instantly share code, notes, and snippets.

@rrichards
Forked from metavida/oembed_providers.rb
Created February 1, 2011 00:40
Show Gist options
  • Save rrichards/805170 to your computer and use it in GitHub Desktop.
Save rrichards/805170 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'oembed'
OEmbed::Providers.register(OEmbed::Providers::Youtube)
OEmbed::Providers.get("http://www.youtube.com/watch?v=2BYXBC8WQ5k").html #=> expected HTML
OEmbed::Providers.get("http://vimeo.com/19231255").html #=> An OEmbed::NotFound error
OEmbed::Providers.register(OEmbed::Providers::Vimeo)
OEmbed::Providers.get("http://vimeo.com/19231255").html #=> expected HTML
OEmbed::Providers.get("http://www.viddler.com/explore/engadget/videos/2378/").html #=> An OEmbed::NotFound error
OEmbed::Providers.register_all
OEmbed::Providers.get("http://www.viddler.com/explore/engadget/videos/2378/", :format=>:json).html #=> expected HTML
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment