Sha256: 79742b49e9ee1effc029e6daac40070f4b33eca1b636fcc195678b8f1fe3c549
Contents?: true
Size: 467 Bytes
Versions: 5
Compression:
Stored size: 467 Bytes
Contents
module LinkThumbnailer class Opengraph def self.parse(object, doc) doc.css('meta').each do |m| if m.attribute('property') && m.attribute('property').to_s.match(/^og:(.+)$/i) object[$1.gsub('-', '_')] = m.attribute('content').to_s end end object[:images] = [] if object[:image] object[:images] << { :source_url => object[:image] } end object end end end
Version data entries
5 entries across 5 versions & 1 rubygems