ruby on rails - Meta Tag Grabber -
i wondering if knows of code/applications/gems grab meta data (title & description) website?
i have recipe site , users can add url of got recipe from, want auto generate title , description of site url submitted.
any ideas/ help!
nokogiri simple html parser, since want meta tag information should simple enough.
require 'nokogiri' require 'open-uri' doc = nokogiri::html(open('http://www.example.com')) doc.xpath('//meta').each |meta| puts meta.name puts meta.content end
Comments
Post a Comment