Module: Oembedr

Extended by:
Configuration, Providers
Defined in:
lib/oembedr.rb,
lib/oembedr/client.rb,
lib/oembedr/version.rb,
lib/oembedr/providers.rb,
lib/oembedr/parsed_url.rb,
lib/oembedr/configuration.rb

Defined Under Namespace

Modules: Configuration, Providers Classes: Client, ParsedUrl

Constant Summary collapse

VERSION =
"1.1.1"

Constants included from Providers

Providers::LIST

Instance Attribute Summary

Attributes included from Configuration

#adapter, #user_agent

Class Method Summary collapse

Methods included from Configuration

configure

Methods included from Providers

known_service?, service_endpoint

Class Method Details

.fetch(url, options = {}) ⇒ Object

Convience method: fetch me an oembed!

Example:

Oembedr.fetch("http://www.youtube.com/watch?v=b9XsTtFu64Y")
Oembedr.fetch("http://www.youtube.com/watch?v=b9XsTtFu64Y",
                :params => { :maxwidth => "150", :maxheight => "100" })

Returns:

  • Faraday::Response or raises error



19
20
21
22
23
24
25
26
# File 'lib/oembedr.rb', line 19

def self.fetch url, options = {}
  client = Oembedr::Client.new(url)
  if client.ready?
    client.get(options)
  else
    false
  end
end