Sha256: 2f4521bb7f0223f973aac1db537fe8aec0dc3a1d29d418c9bfba75f2893d083c
Contents?: true
Size: 813 Bytes
Versions: 8
Compression:
Stored size: 813 Bytes
Contents
# frozen_string_literal: true module OembedProxy # Associated Press Interactives Fauxembed class AssociatedPress AP_REGEX = %r{\Ahttps?:\/\/(?:hosted\.ap\.org\/interactives|interactives\.ap\.org)\/.+}.freeze def handles_url?(url) !AP_REGEX.match(url).nil? end 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 end end
Version data entries
8 entries across 8 versions & 1 rubygems