Roe

Roe is a ruby oEmbed client.

Installation

(sudo) gem install roe

Usage

Roe exposes a method resolve for accessing oEmbed data:

Roe.resolve('http://twitpic.com/7745l9')
# => <Hashie::Rash version="1.0" type="photo" width=240 height=160 >

You can pass an options hash (optional) to refine your query:

Roe.resolve('http://twitpic.com/7745l9', :maxheight => 240)

Under the hood, Roe uses Faraday as well as MultiJson to parse the provider responses. It then converts the response hash into a Hashie::Rash. You can specify an http client by configuring Roe:

Roe.configure do |config|
  config.adapter = :typhoeus
  config.user_agent = 'oEmbed Client'
  config.proxy = ENV['http_proxy']
end

Supported Providers

  • YouTube
  • Flickr
  • Viddler
  • Qik
  • Hulu
  • Revision 3
  • Vimeo
  • Opera
  • Skitch
  • Instagram

TODO

  • add the ability to dynamically add new services
  • support for more providers

Note on Patches/Pull Requests

  • Fork the project.
  • Make your feature addition or bug fix.
  • Add tests for it. This is important so I don't break it in a future version unintentionally.
  • Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
  • Send me a pull request. Bonus points for topic branches.

Copyright

Copyright (c) 2011 Steve Agalloco. See LICENSE for details.