class OembedProxy::AssociatedPress
Associated Press Interactives Fauxembed
Constants
- AP_REGEX
Public Instance Methods
get_data(url, _other_params = {})
click to toggle source
# File lib/oembed_proxy/associated_press.rb, line 12 def get_data(url, _other_params = {}) return nil unless handles_url? url oembed = {} oembed['type'] = 'rich' oembed['version'] = '1.0' oembed['provider_name'] = 'Associated Press' oembed['provider_url'] = 'http://www.ap.org/' oembed['html'] = '<iframe class="ap-embed" width="100%" height="600" frameborder="0" scrolling="yes" marginheight="0" marginwidth="0" src="' + url + '"></iframe>' oembed['width'] = 600 oembed['height'] = 600 oembed end
handles_url?(url)
click to toggle source
# File lib/oembed_proxy/associated_press.rb, line 8 def handles_url?(url) !AP_REGEX.match(url).nil? end