Created
October 23, 2012 18:47
-
-
Save atomotic/3940731 to your computer and use it in GitHub Desktop.
ruby-oai seamless resumption
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| source "http://rubygems.org" | |
| gem "oai", :git => "https://github.com/tjdett/ruby-oai.git", :branch => "seamless-resumption" | |
| gem "redis" | |
| gem "libxml-ruby" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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