Sha256: 81ff386d46193ff3ba5113b09d7259b177ddafb6171240ebf7542ed8e05bc87e
Contents?: true
Size: 464 Bytes
Versions: 7
Compression:
Stored size: 464 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
7 entries across 7 versions & 2 rubygems