Skip to content

Instantly share code, notes, and snippets.

@ricn
Created Apr 9, 2010
Embed
What would you like to do?
require "rubygems"
require "crack"
require "couchrest"
db = CouchRest.database!('http://127.0.0.1:5984/ruby_jobmotel')
jobs_as_xml = Net::HTTP.get_response(URI.parse('http://ruby.jobmotel.com/jobs.xml')).body
parsed_jobs = Crack::XML.parse(jobs_as_xml)
parsed_jobs['jobs'].each do |job|
db.save_doc(job)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment