#!/usr/bin/ruby require 'open-uri' require 'cgi' url = CGI::escape(ARGV[0]) open( "http://validator.w3.org/check?uri=#{ url }" ) { |html| text = html.read text.scan /(.+?)<\/h2>/m do |url| puts url end }