Search code examples
phpruby-on-railsrubyequivalent

Ruby/Rails eqv PHP get_meta_tags


Is there an equivalent ruby/RoR method for PHP get_meta_tags.

I am looking to read the meta tag information of a given url


Solution

  • You could try using Hpricot and do something like:

    doc = Hpricot(URI.parse("http://example.com/").read)
    (doc/'/html/head/meta')
      #=> Elements[...]