| Paste number 44057: | ruby-zoom raw method |
| Pasted by: | jaron |
| When: | 1 year, 11 months ago |
| Share: | Tweet this! | http://paste.lisp.org/+XZT |
| Channel: | #code4lib |
| Paste contents: |
require 'rubygems'
require 'zoom'
require 'marc'
ZOOM::Connection.open('z3950.loc.gov', 7090) do |conn|
conn.database_name = 'Voyager'
conn.preferred_record_syntax = 'USMARC'
rset = conn.search('@attr 1=7 0253333490')
#use the raw method to convert character encoding and feed
#ISO2709 MARC record into ruby-marc
marc = MARC::Record.new_from_marc(rset[0].raw('MARC-8', 'UTF-8'))
marc.leader[9, 1] = 'a' #change leader 9 since now UTF-8
puts marc
endThis paste has no annotations.