Never been to DZone Snippets before?

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

About this user

David Arango http://mildiez.net

« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS 

Extracting web page title

Easy extracting html 'title' element from an url

   1  
   2  require 'open-uri'
   3  
   4  URI.parse('http://google.es').open do |f|
   5  	f.each {|l| if md = (/<title>\s*(.*)\s*<\/title>/iu).match(l) then print md[1] end }
   6  end

« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS