I need to pick up an XML file from a server every 30 minutes and process it. I’ve done similar things before, and using Hpricot it is a pleasure:
#! /usr/bin/env ruby
require ‘rubygems’
require ‘hpricot’
require ‘open-uri’
doc = Hpricot(open(”http://example.com/the_file.xml”))
(doc / :person).each { |person| … }
Couldn’t be simpler. This time, there is a snag: the file is [...]

Recent Comments