DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Extracting Web Page Title
Easy extracting html 'title' element from an url
require 'open-uri'
URI.parse('http://google.es').open do |f|
f.each {|l| if md = (/<title>\s*(.*)\s*<\/title>/iu).match(l) then print md[1] end }
end





