huyha85 / opengraph_parser

Simple Ruby Parser library for parsing OpenGraph protocol (http://ogp.me)
MIT License
59 stars 28 forks source link

How can I get metatags by property value? #18

Open pmaojo opened 7 years ago

pmaojo commented 7 years ago

Hi, not an issue, just a question :)

require 'opengraph_parser'
fb = OpenGraph.new 'https://www.facebook.com/smashmag/')
puts fb.metadata[property="al:ios:url"]# => nothing
require 'opengraph_parser'

fb = OpenGraph.new('https://www.facebook.com/smashmag/')

puts fb.metadata# => {:title=>[{:_value=>"Smashing Magazine"}], :description=>[{:_value=>"Smashing Magazine. 291 378 Me gusta. Smashing Magazine delivers useful and innovative information to Web designers and developers."}], :image=>[{:_value=>"https://scontent-mad1-1.xx.fbcdn.net/v/t1.0-1/p200x200/17352146_10155179903597490_6515514170610847005_n.png?oh=a76c1ec8e8c526aa557545968c5a03ea&oe=598C27D2"}], :url=>[{:_value=>"https://www.facebook.com/smashmag/"}]}

The info I am trying to get is <meta property="al:ios:url" content="fb://page/?id=45576747489" /> Is that possible?