module Oembedr::Providers

Constants

LIST

from ruby-oembed with a couple more I know of from user feedback :).

Public Instance Methods

known_service?(url) click to toggle source

Return a boolean true or false if we can handle the given domain

@param url [String] a fully-qualified URL to an oembeddable resource

@return Boolean

# File lib/oembedr/providers.rb, line 86
def known_service? url
  !!service_endpoint(url)
end
service_endpoint(url) click to toggle source

Locate the correct service endpoint for the given resource URL.

@param url [String] a fully-qualified URL to an oembeddable resource

@return the url, or false if no known endpoint.

# File lib/oembedr/providers.rb, line 74
def service_endpoint url
  endpoint = LIST.find do |(pattern, endpoint)|
    url =~ pattern
  end
  endpoint ? endpoint.last : false
end