Possible Duplicate:
simple parsing in ruby
I am trying to verify a title in a website and after some trial and error I have found that this can be done in ruby by using nokogiri and rest-client
require 'nokogiri'
require 'rest-client'
page = Nokogiri::HTML(RestClient.get("http:/#{user.username}.domain.com/"))
simian = page.at_css("title").text
if simian == "Welcome to"
puts "default monkey"
else
puts "website updated"
end
unfortunately for a large number of websites this doesn't always seems to work as it returns RestClient::InternalServerError at /admin/users/list 500 Internal Server Error
I was wondering if there is any option to achieve the same by simply using mycurl = %x(curl http://........) what would be an efficient way to use that by parsing the title and without using any gem or can the curl option be used directly with nokogiri ? Thanks