Skip to content

Instantly share code, notes, and snippets.

@atomotic
Created October 23, 2012 18:47
Show Gist options
  • Save atomotic/3940731 to your computer and use it in GitHub Desktop.
Save atomotic/3940731 to your computer and use it in GitHub Desktop.
ruby-oai seamless resumption
source "http://rubygems.org"
gem "oai", :git => "https://github.com/tjdett/ruby-oai.git", :branch => "seamless-resumption"
gem "redis"
gem "libxml-ruby"
#!/usr/bin/env ruby
require "rubygems"
require "bundler/setup"
require "redis"
require "oai"
r = Redis.new
client = OAI::Client.new "http://amsdottorato.cib.unibo.it/cgi/oai2", :parser => "libxml"
client.list_records(:metadata_prefix => 'oai_dc').full.each do |record|
r.set record.header.identifier, record.metadata
puts record.header.identifier
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment