miniharvest 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/miniharvest.rb +8 -1
- data/lib/miniharvest/version.rb +1 -1
- 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: 23d51a4e1b9fd2f688d87b51d540969b8785bb0e
|
4
|
+
data.tar.gz: 88f9acd122805ebef5276079b6b252ce844eb070
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 336b99bdf964509395c540bc6c700ca6a912ae66981ab0f64f3532cc811538fd899ac18bbecf8b1b3ceaf41f257e0880e95747a2eeb5602938469a3075e2b9f2
|
7
|
+
data.tar.gz: 87f6d5d112a18c906b21695b2190b6d9d0038aa2cc7988c787646dda7e6fb6f58e7b517f4ad0101fc0ba9c7cd3d4228ac31ef31b0b2bf89f0310aa422bf55209
|
data/lib/miniharvest.rb
CHANGED
@@ -59,6 +59,13 @@ module MiniHarvest
|
|
59
59
|
end
|
60
60
|
end
|
61
61
|
|
62
|
+
def dedupe_records(node)
|
63
|
+
seen = Hash.new(0)
|
64
|
+
node.traverse {|n| n.unlink if (seen[n.to_xml] += 1) > 1}
|
65
|
+
return node
|
66
|
+
end
|
67
|
+
|
68
|
+
|
62
69
|
def get_records(token)
|
63
70
|
params = { :verb => 'ListRecords', :resumptionToken => token[0].text }
|
64
71
|
doc = oai_request(self.oai_base_uri,params)
|
@@ -67,7 +74,7 @@ module MiniHarvest
|
|
67
74
|
if resumption_token != false
|
68
75
|
get_records(resumption_token)
|
69
76
|
else
|
70
|
-
return self.marc_collection.root
|
77
|
+
return dedupe_records(self.marc_collection.root)
|
71
78
|
end
|
72
79
|
end
|
73
80
|
end
|
data/lib/miniharvest/version.rb
CHANGED