miniharvest 0.1.5 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/exe/miniharvest +4 -1
- data/lib/miniharvest/version.rb +1 -1
- data/lib/miniharvest.rb +4 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5487f82a2fd55c10cc459970c1da3b7e79287f37
|
4
|
+
data.tar.gz: 6a26b3fc11e17f9423bcf0d30ac454718a6593d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e45e99872470ec95ace48e61f09cee3b9694302d1c857271d6f9a121a51f71fbb0a987f18282d785aff50e6cc70e8d5a394e5e279d358733807856357032be0c
|
7
|
+
data.tar.gz: 120fe7fd9ab4039c48057b806711f6c5aac845d222d426c18175ac1c5d1045072cafa9a058e63d92f922de896d41da0a8fd691c23edc5d7c75d26ddb58e32b50
|
data/exe/miniharvest
CHANGED
@@ -1,8 +1,11 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
require 'miniharvest'
|
3
|
+
require 'nokogiri'
|
3
4
|
|
4
5
|
mh = MiniHarvest::MiniHarvest.new
|
5
6
|
mh.oai_base_uri = ARGV[0]
|
6
7
|
mh.set = ARGV[1]
|
7
8
|
mh.from = ARGV[2]
|
8
|
-
mh.
|
9
|
+
mh.marc_collection = Nokogiri::XML('<collection xmlns="http://www.loc.gov/MARC21/slim">')
|
10
|
+
marc_xml = mh.get_records(mh.initial_request)
|
11
|
+
File.write(ARGV[3], marc_xml.to_xml)
|
data/lib/miniharvest/version.rb
CHANGED
data/lib/miniharvest.rb
CHANGED
@@ -6,13 +6,11 @@ module MiniHarvest
|
|
6
6
|
require 'open-uri'
|
7
7
|
|
8
8
|
class MiniHarvest
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
attr_accessor :oai_base_uri, :set, :from
|
9
|
+
|
10
|
+
attr_accessor :oai_base_uri, :set, :from, :marc_collection
|
13
11
|
|
14
12
|
def append_to_collection(records)
|
15
|
-
|
13
|
+
self.marc_collection.root.add_child(records)
|
16
14
|
end
|
17
15
|
|
18
16
|
def oai_request(uri,params)
|
@@ -44,8 +42,7 @@ module MiniHarvest
|
|
44
42
|
if resumption_token != ""
|
45
43
|
get_records(resumption_token)
|
46
44
|
else
|
47
|
-
|
48
|
-
return
|
45
|
+
return self.marc_collection
|
49
46
|
end
|
50
47
|
end
|
51
48
|
end
|