Skip to content

Instantly share code, notes, and snippets.

@ricn
Created April 9, 2010 19:14
Show Gist options
  • Save ricn/361477 to your computer and use it in GitHub Desktop.
Save ricn/361477 to your computer and use it in GitHub Desktop.
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