Class: OembedProxy::AssociatedPress
- Inherits:
-
Object
- Object
- OembedProxy::AssociatedPress
- Defined in:
- lib/oembed_proxy/associated_press.rb
Overview
Associated Press Interactives Fauxembed
Constant Summary collapse
- AP_REGEX =
%r{\Ahttps?:\/\/(?:hosted\.ap\.org\/interactives|interactives\.ap\.org)\/.+}.freeze
Instance Method Summary collapse
Instance Method Details
#get_data(url, _other_params = {}) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/oembed_proxy/associated_press.rb', line 12 def get_data(url, _other_params = {}) return nil unless handles_url? url = {} ['type'] = 'rich' ['version'] = '1.0' ['provider_name'] = 'Associated Press' ['provider_url'] = 'http://www.ap.org/' ['html'] = '<iframe class="ap-embed" width="100%" height="600" frameborder="0" scrolling="yes" marginheight="0" marginwidth="0" src="' + url + '"></iframe>' ['width'] = 600 ['height'] = 600 end |
#handles_url?(url) ⇒ Boolean
8 9 10 |
# File 'lib/oembed_proxy/associated_press.rb', line 8 def handles_url?(url) !AP_REGEX.match(url).nil? end |