culturegrid 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile ADDED
@@ -0,0 +1,17 @@
1
+ source "http://rubygems.org"
2
+
3
+ gem "hashie"
4
+ gem "weary"
5
+ gem "nokogiri"
6
+
7
+ # Add dependencies required to use your gem here.
8
+ # Example:
9
+ # gem "activesupport", ">= 2.3.5"
10
+
11
+ # Add dependencies to develop your gem here.
12
+ # Include everything needed to run rake, tests, features, etc.
13
+ group :development do
14
+ gem "bundler", "~> 1.0.0"
15
+ gem "jeweler", "~> 1.5.2"
16
+ gem "rcov"
17
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,28 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ crack (0.1.8)
5
+ git (1.2.5)
6
+ hashie (0.4.0)
7
+ jeweler (1.5.2)
8
+ bundler (~> 1.0.0)
9
+ git (>= 1.2.5)
10
+ rake
11
+ nokogiri (1.4.3.1)
12
+ oauth (0.4.1)
13
+ rake (0.8.7)
14
+ rcov (0.9.9)
15
+ weary (0.7.2)
16
+ crack (>= 0.1.7)
17
+ oauth (>= 0.3.5)
18
+
19
+ PLATFORMS
20
+ ruby
21
+
22
+ DEPENDENCIES
23
+ bundler (~> 1.0.0)
24
+ hashie
25
+ jeweler (~> 1.5.2)
26
+ nokogiri
27
+ rcov
28
+ weary
data/LICENSE.txt ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2011 Stef Lewandowski
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile ADDED
@@ -0,0 +1,55 @@
1
+ require 'rubygems'
2
+ require 'bundler'
3
+ begin
4
+ Bundler.setup(:default, :development)
5
+ rescue Bundler::BundlerError => e
6
+ $stderr.puts e.message
7
+ $stderr.puts "Run `bundle install` to install missing gems"
8
+ exit e.status_code
9
+ end
10
+ require 'rake'
11
+
12
+ require 'jeweler'
13
+ Jeweler::Tasks.new do |gem|
14
+ # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
15
+ gem.name = "culturegrid"
16
+ gem.homepage = "http://github.com/stefl/culturegrid"
17
+ gem.license = "MIT"
18
+ gem.summary = "Simple access to the CultureGrid API"
19
+ gem.description = "Simple access to the CultureGrid API"
20
+ gem.email = "stef@stef.io"
21
+ gem.authors = ["steflewandowski"]
22
+ # Include your dependencies below. Runtime dependencies are required when using your gem,
23
+ # and development dependencies are only needed for development (ie running rake tasks, tests, etc)
24
+ gem.add_runtime_dependency 'nokogiri'
25
+ gem.add_runtime_dependency 'hashie'
26
+ gem.add_runtime_dependency 'weary'
27
+ gem.add_development_dependency 'rspec'
28
+ end
29
+ Jeweler::RubygemsDotOrgTasks.new
30
+
31
+ require 'rake/testtask'
32
+ Rake::TestTask.new(:test) do |test|
33
+ test.libs << 'lib' << 'test'
34
+ test.pattern = 'test/**/test_*.rb'
35
+ test.verbose = true
36
+ end
37
+
38
+ require 'rcov/rcovtask'
39
+ Rcov::RcovTask.new do |test|
40
+ test.libs << 'test'
41
+ test.pattern = 'test/**/test_*.rb'
42
+ test.verbose = true
43
+ end
44
+
45
+ task :default => :test
46
+
47
+ require 'rake/rdoctask'
48
+ Rake::RDocTask.new do |rdoc|
49
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
50
+
51
+ rdoc.rdoc_dir = 'rdoc'
52
+ rdoc.title = "culturegrid #{version}"
53
+ rdoc.rdoc_files.include('README*')
54
+ rdoc.rdoc_files.include('lib/**/*.rb')
55
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.0
@@ -0,0 +1,68 @@
1
+ require 'nokogiri'
2
+ require 'open-uri'
3
+ require 'hashie'
4
+ require 'weary'
5
+
6
+ module CultureGrid
7
+
8
+ def self.search(terms, opts={})
9
+ CultureGrid::Index.new.search(terms)
10
+ end
11
+
12
+ class Index
13
+
14
+ def initialize(base="http://culturegrid.org.uk/index/select/")
15
+ @base = base
16
+ end
17
+
18
+ def get(opts)
19
+ q = []
20
+ opts[:version] ||= "2.2"
21
+ opts[:indent] ||= "on"
22
+ opts.each_pair do |opt,val|
23
+ q << "#{opt}=#{CGI::escape(val)}"
24
+ end
25
+ url = "#{@base}?#{q.join("&")}"
26
+ puts url
27
+
28
+ Nokogiri::XML(Weary.get(url).perform.body)
29
+ end
30
+
31
+ def result(opts)
32
+ self.get(opts).css("doc").collect{|a| Doc.new(a)}
33
+ end
34
+
35
+ def query(terms, opts={})
36
+ self.result({:q=>terms}.merge(opts))
37
+ end
38
+
39
+ def search(terms, opts={})
40
+ self.query("dc.title all \"#{terms}\" OR fullText all \"#{terms}\"", opts)
41
+ end
42
+
43
+ end
44
+
45
+ class Doc < Hashie::Mash
46
+ def initialize(d = nil, default = nil, &blk)
47
+ hash = {}
48
+ if d && d.children
49
+ d.children.each do |prop|
50
+ if prop.attributes["name"]
51
+ case prop.name
52
+ when "arr"
53
+ hash[prop.attributes["name"].value] = prop.children.collect{|c| c.text}
54
+ else
55
+ if prop.children
56
+ hash[prop.attributes["name"].value] = prop.children.text
57
+ else
58
+ hash[prop.attributes["name"].value] = prop.text
59
+ end
60
+ end
61
+ end
62
+ end
63
+ end
64
+ puts hash.inspect
65
+ super(hash, default, &blk) rescue super({})
66
+ end
67
+ end
68
+ end
data/readme.md ADDED
@@ -0,0 +1,75 @@
1
+ Culturegrid
2
+ ===========
3
+
4
+ [Culturegrid](http://www.culturegrid.org.uk/) provides an XML API for searching cultural datasets in the UK. I don't know about you, but to be honest I find these kinds of things quite hard to work with in their raw form. Lots of Dublin Core metadata floating around in nested XML tags, and so on.
5
+
6
+ So, here's a ruby gem that simplifies a few use cases for the API and let's you get on with your mashup.
7
+
8
+ To use
9
+
10
+ gem install culturegrid
11
+
12
+ Example:
13
+
14
+ require 'culturegrid'
15
+
16
+ grid = CultureGrid::Index.new
17
+ => #<CultureGrid::Index:0x10139a920 @base="http://culturegrid.org.uk/index/select/">
18
+
19
+ results = grid.search("scree")
20
+
21
+ results.size
22
+ => 10
23
+
24
+ ascent_of_snowdon = results.last
25
+
26
+ pp ascent_of_snowdon
27
+ => {"aggregator.internal.id"=>"2103130",
28
+ "aggregator.internal_record_link"=>
29
+ "/dpp/resource/2103130/stream/CultureGrid_Item",
30
+ "dc.language"=>"EN-GB",
31
+ "dc.title"=>["Ascent of Snowdon from Rhyd-ddu, Screes near top"],
32
+ "dcterms.rightsHolder"=>"Kirklees",
33
+ "dcterms.spatial"=>["Kirklees"],
34
+ "timestamp"=>"2010-12-07T09:38:02.324Z",
35
+ "dc.contributor"=>["Kirklees"],
36
+ "dcterms.isPartOf_AllNames"=>
37
+ "People's Network|CG_BREAK|Kirklees Image Archive",
38
+ "cached_thumbnail"=>"/dpp/resource/2103130/stream/thumbnail_image_jpeg",
39
+ "dc.identifier"=>
40
+ "http://www.kirkleesimages.org.uk/frontend.php?keywords=Ref_No_increment;EQUALS;kw01090&pos=2&action=zoom",
41
+ "dcmi.type"=>["Image"],
42
+ "pndsterms.thumbnail"=>
43
+ "https://www.hpacde.org.uk/kirklees/jpgs_kirklees/kw01090.jpg",
44
+ "dc.related.link"=>
45
+ "http://www.kirkleesimages.org.uk/frontend.php?keywords=Ref_No_increment;EQUALS;kw01090&pos=2&action=zoom",
46
+ "have_temporal"=>"false",
47
+ "dc.format"=>["JPEG/IMAGE"],
48
+ "dc.publisher"=>"Kirklees",
49
+ "authority"=>"KirkleesImages",
50
+ "authority_name"=>"Kirklees Image Archive OAI Feed",
51
+ "dc.subject"=>["Kirklees"],
52
+ "dcterms.license"=>"http://creativecommons.org/licenses/by-nc-nd/2.0/uk/",
53
+ "dc.location"=>"Kirklees",
54
+ "dcterms.isPartOf"=>["PN", "KirkleesImageArchive"],
55
+ "dcterms.isPartOf_AllIDs"=>"PN|CG_BREAK|KirkleesImageArchive",
56
+ "dcterms.isPartOf_Name"=>["People's Network", "Kirklees Image Archive"],
57
+ "dcterms.audience"=>["General_Educational"],
58
+ "restp"=>"ServiceProvider"}
59
+
60
+ ascent_of_snowdon.authority
61
+ => "KirkleesImages"
62
+
63
+ ascent_of_snowdon.title
64
+ => "Ascent of Snowdon from Rhyd-ddu, Screes near top"
65
+
66
+ ascent_of_snowdon["dcterms.isPartOf"]
67
+ => ["PN", "KirkleesImageArchive"]
68
+
69
+ Each result is a CultureGrid::Doc, which is a Hashie::Mash, so look at this:
70
+
71
+ require 'json'
72
+ require 'culturegrid'
73
+
74
+ CultureGrid.search("joy").first.to_json
75
+ => "{\"dcterms.rightsHolder\":\"Leeds Central Library\",\"dc.title\":[\"York Road, Joy's Fold\"],\"aggregator.internal_record_link\":\"/dpp/resource/2541087/stream/CultureGrid_Item\",\"aggregator.internal.id\":\"2541087\",\"dcterms.spatial\":[\"World, Europe, United Kingdom\"],\"timestamp\":\"2010-12-07T11:08:13.869Z\",\"dcterms.isPartOf_AllNames\":\"People's Network|CG_BREAK|Leodis\",\"pndsterms.thumbnail\":\"http://www.leodis.net/imagesLeodis/thumbnail/24/20091124_169824.jpg\",\"dcmi.type\":[\"Image\"],\"dc.identifier\":\"http://www.leodis.net/display.aspx?id=20091124_169824\",\"dc.description\":[\"18th September 1935.\\nView of Joy's Fold, a yard off York Road near the junction with Marsh Lane. In the centre are the premises of Cecil Gilbert, shoeing smith, of no.15 Joy's Fold. These buildings were all soon to be demolished as part of the slum clearance programme in the area.\"],\"cached_thumbnail\":\"/dpp/resource/2541087/stream/thumbnail_image_jpeg\",\"have_temporal\":\"false\",\"dc.related.link\":\"http://www.leodis.net/display.aspx?id=20091124_169824\",\"dcterms.license\":\"http://www.leodis.net/article.aspx?id=12\",\"dc.subject\":[\"York Road\",\"Joy's Fold\"],\"authority_name\":\"Leodis - A photographic archive of Leeds\",\"authority\":\"Leodis\",\"dcterms.isPartOf_AllIDs\":\"PN|CG_BREAK|Leodis\",\"dcterms.isPartOf\":[\"PN\",\"Leodis\"],\"dcterms.isPartOf_Name\":[\"People's Network\",\"Leodis\"],\"restp\":\"ServiceProvider\"}"
@@ -0,0 +1,32 @@
1
+ $:.unshift(File.expand_path(File.join(File.dirname(__FILE__), "..","lib")))
2
+ require 'spec_helper'
3
+ require "culturegrid"
4
+
5
+ describe CultureGrid::Index do
6
+
7
+ before do
8
+ @grid = CultureGrid::Index.new
9
+ end
10
+
11
+ describe "Searching for things" do
12
+
13
+ before do
14
+ WebMock.stub_request(:get, /.*/).to_return(:body => File.open(File.join(File.expand_path(File.dirname(__FILE__)),"example_response.xml")).read)
15
+ end
16
+
17
+ it "should find a set of things for a valid search" do
18
+ @grid.search("scree").size.should eql(10)
19
+ end
20
+
21
+ it "should parse the results into Docs" do
22
+ @grid.search("scree").first.should be_a(CultureGrid::Doc)
23
+ end
24
+
25
+ it "should deserialize Docs into hashie mashes" do
26
+ @grid.search("scree").first["dc.title"].should eql(["Screes near Badger Slacks"])
27
+ @grid.search("scree").first["pndsterms.thumbnail"].should eql("https://www.hpacde.org.uk/kirklees/jpgs_kirklees/k006195.jpg")
28
+ end
29
+
30
+ end
31
+
32
+ end
@@ -0,0 +1,291 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <response>
3
+
4
+ <lst name="responseHeader">
5
+ <int name="status">0</int>
6
+ <int name="QTime">562</int>
7
+ <lst name="params">
8
+ <str name="indent">on</str>
9
+ <str name="rows">10</str>
10
+ <str name="version">2.2</str>
11
+ <str name="start">0</str>
12
+ <str name="q">dc.title all "Scree" OR fullText all "Scree"</str>
13
+ </lst>
14
+ </lst>
15
+ <result name="response" numFound="32486" start="0">
16
+ <doc>
17
+ <str name="aggregator.internal.id">2082977</str>
18
+ <str name="aggregator.internal_record_link">/dpp/resource/2082977/stream/CultureGrid_Item</str>
19
+ <str name="authority">KirkleesImages</str>
20
+ <str name="authority_name">Kirklees Image Archive OAI Feed</str>
21
+ <str name="cached_thumbnail">/dpp/resource/2082977/stream/thumbnail_image_jpeg</str>
22
+ <arr name="dc.contributor"><str>Kirklees</str></arr>
23
+ <arr name="dc.format"><str>JPEG/IMAGE</str></arr>
24
+ <str name="dc.identifier">http://www.kirkleesimages.org.uk/frontend.php?keywords=Ref_No_increment;EQUALS;k006195&amp;pos=2&amp;action=zoom</str>
25
+ <str name="dc.language">EN-GB</str>
26
+ <str name="dc.location">Kirklees</str>
27
+ <str name="dc.publisher">Kirklees</str>
28
+ <str name="dc.related.link">http://www.kirkleesimages.org.uk/frontend.php?keywords=Ref_No_increment;EQUALS;k006195&amp;pos=2&amp;action=zoom</str>
29
+ <arr name="dc.subject"><str>Kirklees</str></arr>
30
+ <arr name="dc.title"><str>Screes near Badger Slacks</str></arr>
31
+ <arr name="dcmi.type"><str>Image</str></arr>
32
+ <arr name="dcterms.audience"><str>General_Educational</str></arr>
33
+ <arr name="dcterms.isPartOf"><str>PN</str><str>KirkleesImageArchive</str></arr>
34
+ <str name="dcterms.isPartOf_AllIDs">PN|CG_BREAK|KirkleesImageArchive</str>
35
+ <str name="dcterms.isPartOf_AllNames">People's Network|CG_BREAK|Kirklees Image Archive</str>
36
+ <arr name="dcterms.isPartOf_Name"><str>People's Network</str><str>Kirklees Image Archive</str></arr>
37
+ <str name="dcterms.license">http://creativecommons.org/licenses/by-nc-nd/2.0/uk/</str>
38
+ <str name="dcterms.rightsHolder">Kirklees</str>
39
+ <arr name="dcterms.spatial"><str>Kirklees</str></arr>
40
+ <bool name="have_temporal">false</bool>
41
+ <str name="pndsterms.thumbnail">https://www.hpacde.org.uk/kirklees/jpgs_kirklees/k006195.jpg</str>
42
+ <str name="restp">ServiceProvider</str>
43
+ <date name="timestamp">2010-12-07T09:30:24.793Z</date>
44
+ </doc>
45
+ <doc>
46
+ <str name="aggregator.internal.id">2082978</str>
47
+ <str name="aggregator.internal_record_link">/dpp/resource/2082978/stream/CultureGrid_Item</str>
48
+ <str name="authority">KirkleesImages</str>
49
+ <str name="authority_name">Kirklees Image Archive OAI Feed</str>
50
+ <str name="cached_thumbnail">/dpp/resource/2082978/stream/thumbnail_image_jpeg</str>
51
+ <arr name="dc.contributor"><str>Kirklees</str></arr>
52
+ <arr name="dc.format"><str>JPEG/IMAGE</str></arr>
53
+ <str name="dc.identifier">http://www.kirkleesimages.org.uk/frontend.php?keywords=Ref_No_increment;EQUALS;k006196&amp;pos=2&amp;action=zoom</str>
54
+ <str name="dc.language">EN-GB</str>
55
+ <str name="dc.location">Kirklees</str>
56
+ <str name="dc.publisher">Kirklees</str>
57
+ <str name="dc.related.link">http://www.kirkleesimages.org.uk/frontend.php?keywords=Ref_No_increment;EQUALS;k006196&amp;pos=2&amp;action=zoom</str>
58
+ <arr name="dc.subject"><str>Kirklees</str></arr>
59
+ <arr name="dc.title"><str>Screes near Badger Slacks</str></arr>
60
+ <arr name="dcmi.type"><str>Image</str></arr>
61
+ <arr name="dcterms.audience"><str>General_Educational</str></arr>
62
+ <arr name="dcterms.isPartOf"><str>PN</str><str>KirkleesImageArchive</str></arr>
63
+ <str name="dcterms.isPartOf_AllIDs">PN|CG_BREAK|KirkleesImageArchive</str>
64
+ <str name="dcterms.isPartOf_AllNames">People's Network|CG_BREAK|Kirklees Image Archive</str>
65
+ <arr name="dcterms.isPartOf_Name"><str>People's Network</str><str>Kirklees Image Archive</str></arr>
66
+ <str name="dcterms.license">http://creativecommons.org/licenses/by-nc-nd/2.0/uk/</str>
67
+ <str name="dcterms.rightsHolder">Kirklees</str>
68
+ <arr name="dcterms.spatial"><str>Kirklees</str></arr>
69
+ <bool name="have_temporal">false</bool>
70
+ <str name="pndsterms.thumbnail">https://www.hpacde.org.uk/kirklees/jpgs_kirklees/k006196.jpg</str>
71
+ <str name="restp">ServiceProvider</str>
72
+ <date name="timestamp">2010-12-07T09:30:25.06Z</date>
73
+ </doc>
74
+ <doc>
75
+ <str name="aggregator.internal.id">2102735</str>
76
+ <str name="aggregator.internal_record_link">/dpp/resource/2102735/stream/CultureGrid_Item</str>
77
+ <str name="authority">KirkleesImages</str>
78
+ <str name="authority_name">Kirklees Image Archive OAI Feed</str>
79
+ <str name="cached_thumbnail">/dpp/resource/2102735/stream/thumbnail_image_jpeg</str>
80
+ <arr name="dc.contributor"><str>Kirklees</str></arr>
81
+ <arr name="dc.format"><str>JPEG/IMAGE</str></arr>
82
+ <str name="dc.identifier">http://www.kirkleesimages.org.uk/frontend.php?keywords=Ref_No_increment;EQUALS;kw00690&amp;pos=2&amp;action=zoom</str>
83
+ <str name="dc.language">EN-GB</str>
84
+ <str name="dc.location">Kirklees</str>
85
+ <str name="dc.publisher">Kirklees</str>
86
+ <str name="dc.related.link">http://www.kirkleesimages.org.uk/frontend.php?keywords=Ref_No_increment;EQUALS;kw00690&amp;pos=2&amp;action=zoom</str>
87
+ <arr name="dc.subject"><str>Kirklees</str></arr>
88
+ <arr name="dc.title"><str>Wastwater Screes</str></arr>
89
+ <arr name="dcmi.type"><str>Image</str></arr>
90
+ <arr name="dcterms.audience"><str>General_Educational</str></arr>
91
+ <arr name="dcterms.isPartOf"><str>PN</str><str>KirkleesImageArchive</str></arr>
92
+ <str name="dcterms.isPartOf_AllIDs">PN|CG_BREAK|KirkleesImageArchive</str>
93
+ <str name="dcterms.isPartOf_AllNames">People's Network|CG_BREAK|Kirklees Image Archive</str>
94
+ <arr name="dcterms.isPartOf_Name"><str>People's Network</str><str>Kirklees Image Archive</str></arr>
95
+ <str name="dcterms.license">http://creativecommons.org/licenses/by-nc-nd/2.0/uk/</str>
96
+ <str name="dcterms.rightsHolder">Kirklees</str>
97
+ <arr name="dcterms.spatial"><str>Kirklees</str></arr>
98
+ <bool name="have_temporal">false</bool>
99
+ <str name="pndsterms.thumbnail">https://www.hpacde.org.uk/kirklees/jpgs_kirklees/kw00690.jpg</str>
100
+ <str name="restp">ServiceProvider</str>
101
+ <date name="timestamp">2010-12-07T09:35:35.596Z</date>
102
+ </doc>
103
+ <doc>
104
+ <str name="aggregator.internal.id">2082365</str>
105
+ <str name="aggregator.internal_record_link">/dpp/resource/2082365/stream/CultureGrid_Item</str>
106
+ <str name="authority">KirkleesImages</str>
107
+ <str name="authority_name">Kirklees Image Archive OAI Feed</str>
108
+ <str name="cached_thumbnail">/dpp/resource/2082365/stream/thumbnail_image_jpeg</str>
109
+ <arr name="dc.contributor"><str>Kirklees</str></arr>
110
+ <arr name="dc.format"><str>JPEG/IMAGE</str></arr>
111
+ <str name="dc.identifier">http://www.kirkleesimages.org.uk/frontend.php?keywords=Ref_No_increment;EQUALS;k005581&amp;pos=2&amp;action=zoom</str>
112
+ <str name="dc.language">EN-GB</str>
113
+ <str name="dc.location">Kirklees</str>
114
+ <str name="dc.publisher">Kirklees</str>
115
+ <str name="dc.related.link">http://www.kirkleesimages.org.uk/frontend.php?keywords=Ref_No_increment;EQUALS;k005581&amp;pos=2&amp;action=zoom</str>
116
+ <arr name="dc.subject"><str>Kirklees</str></arr>
117
+ <arr name="dc.title"><str>The Screes, Wast Water, Lake District</str></arr>
118
+ <arr name="dcmi.type"><str>Image</str></arr>
119
+ <arr name="dcterms.audience"><str>General_Educational</str></arr>
120
+ <arr name="dcterms.isPartOf"><str>PN</str><str>KirkleesImageArchive</str></arr>
121
+ <str name="dcterms.isPartOf_AllIDs">PN|CG_BREAK|KirkleesImageArchive</str>
122
+ <str name="dcterms.isPartOf_AllNames">People's Network|CG_BREAK|Kirklees Image Archive</str>
123
+ <arr name="dcterms.isPartOf_Name"><str>People's Network</str><str>Kirklees Image Archive</str></arr>
124
+ <str name="dcterms.license">http://creativecommons.org/licenses/by-nc-nd/2.0/uk/</str>
125
+ <str name="dcterms.rightsHolder">Kirklees</str>
126
+ <arr name="dcterms.spatial"><str>Kirklees</str></arr>
127
+ <bool name="have_temporal">false</bool>
128
+ <str name="pndsterms.thumbnail">https://www.hpacde.org.uk/kirklees/jpgs_kirklees/k005581.jpg</str>
129
+ <str name="restp">ServiceProvider</str>
130
+ <date name="timestamp">2010-12-07T09:38:21.755Z</date>
131
+ </doc>
132
+ <doc>
133
+ <str name="aggregator.internal.id">2082367</str>
134
+ <str name="aggregator.internal_record_link">/dpp/resource/2082367/stream/CultureGrid_Item</str>
135
+ <str name="authority">KirkleesImages</str>
136
+ <str name="authority_name">Kirklees Image Archive OAI Feed</str>
137
+ <str name="cached_thumbnail">/dpp/resource/2082367/stream/thumbnail_image_jpeg</str>
138
+ <arr name="dc.contributor"><str>Kirklees</str></arr>
139
+ <arr name="dc.format"><str>JPEG/IMAGE</str></arr>
140
+ <str name="dc.identifier">http://www.kirkleesimages.org.uk/frontend.php?keywords=Ref_No_increment;EQUALS;k005583&amp;pos=2&amp;action=zoom</str>
141
+ <str name="dc.language">EN-GB</str>
142
+ <str name="dc.location">Kirklees</str>
143
+ <str name="dc.publisher">Kirklees</str>
144
+ <str name="dc.related.link">http://www.kirkleesimages.org.uk/frontend.php?keywords=Ref_No_increment;EQUALS;k005583&amp;pos=2&amp;action=zoom</str>
145
+ <arr name="dc.subject"><str>Kirklees</str></arr>
146
+ <arr name="dc.title"><str>The Screes, Wast Water, Lake District</str></arr>
147
+ <arr name="dcmi.type"><str>Image</str></arr>
148
+ <arr name="dcterms.audience"><str>General_Educational</str></arr>
149
+ <arr name="dcterms.isPartOf"><str>PN</str><str>KirkleesImageArchive</str></arr>
150
+ <str name="dcterms.isPartOf_AllIDs">PN|CG_BREAK|KirkleesImageArchive</str>
151
+ <str name="dcterms.isPartOf_AllNames">People's Network|CG_BREAK|Kirklees Image Archive</str>
152
+ <arr name="dcterms.isPartOf_Name"><str>People's Network</str><str>Kirklees Image Archive</str></arr>
153
+ <str name="dcterms.license">http://creativecommons.org/licenses/by-nc-nd/2.0/uk/</str>
154
+ <str name="dcterms.rightsHolder">Kirklees</str>
155
+ <arr name="dcterms.spatial"><str>Kirklees</str></arr>
156
+ <bool name="have_temporal">false</bool>
157
+ <str name="pndsterms.thumbnail">https://www.hpacde.org.uk/kirklees/jpgs_kirklees/k005583.jpg</str>
158
+ <str name="restp">ServiceProvider</str>
159
+ <date name="timestamp">2010-12-07T09:38:22.31Z</date>
160
+ </doc>
161
+ <doc>
162
+ <str name="aggregator.internal.id">2674747</str>
163
+ <str name="aggregator.internal_record_link">/dpp/resource/2674747/stream/CultureGrid_Item</str>
164
+ <str name="authority">BCH</str>
165
+ <str name="authority_name">Black Country History</str>
166
+ <arr name="dc.description"><str>Arms of Crinoid</str></arr>
167
+ <str name="dc.identifier">http://www.blackcountryhistory.org/collections/getrecord/DMUSE_001948</str>
168
+ <str name="dc.publisher">Dudley Museums Service</str>
169
+ <str name="dc.related.link">http://www.blackcountryhistory.org/collections/getrecord/DMUSE_001948</str>
170
+ <arr name="dc.subject"><str>David Ray Collection</str></arr>
171
+ <arr name="dc.title"><str>Crinoid</str></arr>
172
+ <arr name="dcmi.type"><str>Unknown</str></arr>
173
+ <arr name="dcterms.isPartOf"><str>BlackCountryHistory</str><str>PN</str></arr>
174
+ <str name="dcterms.isPartOf_AllIDs">BlackCountryHistory|CG_BREAK|PN</str>
175
+ <str name="dcterms.isPartOf_AllNames">Black Country History|CG_BREAK|People's Network</str>
176
+ <arr name="dcterms.isPartOf_Name"><str>Black Country History</str><str>People's Network</str></arr>
177
+ <str name="dcterms.license">http://creativecommons.org/licenses/by/2.0/uk/</str>
178
+ <str name="dcterms.rightsHolder">Dudley Museums Service</str>
179
+ <arr name="dcterms.spatial"><str>Wren's Nest GR: 393560 291956 Scree</str></arr>
180
+ <arr name="dcterms.temporal"><str>Silurian, Much Wenlock Limstone, Nodular Member.</str></arr>
181
+ <bool name="have_temporal">false</bool>
182
+ <arr name="otherDcIdentifier"><str>001948</str><str>Geology</str></arr>
183
+ <str name="restp">ServiceProvider</str>
184
+ <date name="timestamp">2011-01-10T08:54:28.135Z</date>
185
+ </doc>
186
+ <doc>
187
+ <str name="aggregator.internal.id">2674330</str>
188
+ <str name="aggregator.internal_record_link">/dpp/resource/2674330/stream/CultureGrid_Item</str>
189
+ <str name="authority">BCH</str>
190
+ <str name="authority_name">Black Country History</str>
191
+ <arr name="dc.description"><str>Fossil Acidaspis limestone Wren's Nest GR: 393535 291870 scree Dudley Silurian c425my incomplete cephalon</str></arr>
192
+ <str name="dc.identifier">http://www.blackcountryhistory.org/collections/getrecord/DMUSE_001954</str>
193
+ <str name="dc.publisher">Dudley Museums Service</str>
194
+ <str name="dc.related.link">http://www.blackcountryhistory.org/collections/getrecord/DMUSE_001954</str>
195
+ <arr name="dc.subject"><str>David Ray Collection</str></arr>
196
+ <arr name="dc.title"><str>Trilobite</str></arr>
197
+ <arr name="dcmi.type"><str>Unknown</str></arr>
198
+ <arr name="dcterms.isPartOf"><str>BlackCountryHistory</str><str>PN</str></arr>
199
+ <str name="dcterms.isPartOf_AllIDs">BlackCountryHistory|CG_BREAK|PN</str>
200
+ <str name="dcterms.isPartOf_AllNames">Black Country History|CG_BREAK|People's Network</str>
201
+ <arr name="dcterms.isPartOf_Name"><str>Black Country History</str><str>People's Network</str></arr>
202
+ <str name="dcterms.license">http://creativecommons.org/licenses/by/2.0/uk/</str>
203
+ <str name="dcterms.rightsHolder">Dudley Museums Service</str>
204
+ <arr name="dcterms.spatial"><str>Wren's Nest GR: 393535 291870 scree</str></arr>
205
+ <arr name="dcterms.temporal"><str>Silurian, Much Wenlock Limstone, Nodular Member.</str></arr>
206
+ <bool name="have_temporal">false</bool>
207
+ <arr name="otherDcIdentifier"><str>001954</str><str>Geology</str></arr>
208
+ <str name="restp">ServiceProvider</str>
209
+ <date name="timestamp">2011-01-10T08:52:11.109Z</date>
210
+ </doc>
211
+ <doc>
212
+ <str name="aggregator.internal.id">2674332</str>
213
+ <str name="aggregator.internal_record_link">/dpp/resource/2674332/stream/CultureGrid_Item</str>
214
+ <str name="authority">BCH</str>
215
+ <str name="authority_name">Black Country History</str>
216
+ <arr name="dc.description"><str>Fossil Cybantyx limestone Wren's Nest GR: 393566 292028 scree Dudley Silurian c425my incomplete pygidium</str></arr>
217
+ <str name="dc.identifier">http://www.blackcountryhistory.org/collections/getrecord/DMUSE_001946</str>
218
+ <str name="dc.publisher">Dudley Museums Service</str>
219
+ <str name="dc.related.link">http://www.blackcountryhistory.org/collections/getrecord/DMUSE_001946</str>
220
+ <arr name="dc.subject"><str>David Ray Collection</str></arr>
221
+ <arr name="dc.title"><str>Trilobite</str></arr>
222
+ <arr name="dcmi.type"><str>Unknown</str></arr>
223
+ <arr name="dcterms.isPartOf"><str>BlackCountryHistory</str><str>PN</str></arr>
224
+ <str name="dcterms.isPartOf_AllIDs">BlackCountryHistory|CG_BREAK|PN</str>
225
+ <str name="dcterms.isPartOf_AllNames">Black Country History|CG_BREAK|People's Network</str>
226
+ <arr name="dcterms.isPartOf_Name"><str>Black Country History</str><str>People's Network</str></arr>
227
+ <str name="dcterms.license">http://creativecommons.org/licenses/by/2.0/uk/</str>
228
+ <str name="dcterms.rightsHolder">Dudley Museums Service</str>
229
+ <arr name="dcterms.spatial"><str>Wren's Nest GR: 393566 292028 Scree</str></arr>
230
+ <arr name="dcterms.temporal"><str>Silurian - Wenlock - Homerian. Much Wenlock Limstone, Nodular Member.</str></arr>
231
+ <bool name="have_temporal">false</bool>
232
+ <arr name="otherDcIdentifier"><str>001946</str><str>Geology</str></arr>
233
+ <str name="restp">ServiceProvider</str>
234
+ <date name="timestamp">2011-01-10T08:52:11.788Z</date>
235
+ </doc>
236
+ <doc>
237
+ <str name="aggregator.internal.id">2674997</str>
238
+ <str name="aggregator.internal_record_link">/dpp/resource/2674997/stream/CultureGrid_Item</str>
239
+ <str name="authority">BCH</str>
240
+ <str name="authority_name">Black Country History</str>
241
+ <arr name="dc.description"><str>Fossil Calymene limestone Wren's Nest GR: 393578 292047scree Dudley Silurian c425my complete enrolled</str></arr>
242
+ <str name="dc.identifier">http://www.blackcountryhistory.org/collections/getrecord/DMUSE_001947</str>
243
+ <str name="dc.publisher">Dudley Museums Service</str>
244
+ <str name="dc.related.link">http://www.blackcountryhistory.org/collections/getrecord/DMUSE_001947</str>
245
+ <arr name="dc.subject"><str>David Ray Collection</str></arr>
246
+ <arr name="dc.title"><str>Trilobite</str></arr>
247
+ <arr name="dcmi.type"><str>Unknown</str></arr>
248
+ <arr name="dcterms.isPartOf"><str>BlackCountryHistory</str><str>PN</str></arr>
249
+ <str name="dcterms.isPartOf_AllIDs">BlackCountryHistory|CG_BREAK|PN</str>
250
+ <str name="dcterms.isPartOf_AllNames">Black Country History|CG_BREAK|People's Network</str>
251
+ <arr name="dcterms.isPartOf_Name"><str>Black Country History</str><str>People's Network</str></arr>
252
+ <str name="dcterms.license">http://creativecommons.org/licenses/by/2.0/uk/</str>
253
+ <str name="dcterms.rightsHolder">Dudley Museums Service</str>
254
+ <arr name="dcterms.spatial"><str>Wren's Nest GR: 393578 292047 Scree</str></arr>
255
+ <arr name="dcterms.temporal"><str>Silurian, Much Wenlock Limstone, Nodular Member.</str></arr>
256
+ <bool name="have_temporal">false</bool>
257
+ <arr name="otherDcIdentifier"><str>001947</str><str>Geology</str></arr>
258
+ <str name="restp">ServiceProvider</str>
259
+ <date name="timestamp">2011-01-10T08:55:59.483Z</date>
260
+ </doc>
261
+ <doc>
262
+ <str name="aggregator.internal.id">2103130</str>
263
+ <str name="aggregator.internal_record_link">/dpp/resource/2103130/stream/CultureGrid_Item</str>
264
+ <str name="authority">KirkleesImages</str>
265
+ <str name="authority_name">Kirklees Image Archive OAI Feed</str>
266
+ <str name="cached_thumbnail">/dpp/resource/2103130/stream/thumbnail_image_jpeg</str>
267
+ <arr name="dc.contributor"><str>Kirklees</str></arr>
268
+ <arr name="dc.format"><str>JPEG/IMAGE</str></arr>
269
+ <str name="dc.identifier">http://www.kirkleesimages.org.uk/frontend.php?keywords=Ref_No_increment;EQUALS;kw01090&amp;pos=2&amp;action=zoom</str>
270
+ <str name="dc.language">EN-GB</str>
271
+ <str name="dc.location">Kirklees</str>
272
+ <str name="dc.publisher">Kirklees</str>
273
+ <str name="dc.related.link">http://www.kirkleesimages.org.uk/frontend.php?keywords=Ref_No_increment;EQUALS;kw01090&amp;pos=2&amp;action=zoom</str>
274
+ <arr name="dc.subject"><str>Kirklees</str></arr>
275
+ <arr name="dc.title"><str>Ascent of Snowdon from Rhyd-ddu, Screes near top</str></arr>
276
+ <arr name="dcmi.type"><str>Image</str></arr>
277
+ <arr name="dcterms.audience"><str>General_Educational</str></arr>
278
+ <arr name="dcterms.isPartOf"><str>PN</str><str>KirkleesImageArchive</str></arr>
279
+ <str name="dcterms.isPartOf_AllIDs">PN|CG_BREAK|KirkleesImageArchive</str>
280
+ <str name="dcterms.isPartOf_AllNames">People's Network|CG_BREAK|Kirklees Image Archive</str>
281
+ <arr name="dcterms.isPartOf_Name"><str>People's Network</str><str>Kirklees Image Archive</str></arr>
282
+ <str name="dcterms.license">http://creativecommons.org/licenses/by-nc-nd/2.0/uk/</str>
283
+ <str name="dcterms.rightsHolder">Kirklees</str>
284
+ <arr name="dcterms.spatial"><str>Kirklees</str></arr>
285
+ <bool name="have_temporal">false</bool>
286
+ <str name="pndsterms.thumbnail">https://www.hpacde.org.uk/kirklees/jpgs_kirklees/kw01090.jpg</str>
287
+ <str name="restp">ServiceProvider</str>
288
+ <date name="timestamp">2010-12-07T09:38:02.324Z</date>
289
+ </doc>
290
+ </result>
291
+ </response>
@@ -0,0 +1,6 @@
1
+ require 'spec'
2
+ require 'mocha'
3
+ require 'webmock/rspec'
4
+
5
+ Spec::Runner.configure do |config|
6
+ end
metadata ADDED
@@ -0,0 +1,220 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: culturegrid
3
+ version: !ruby/object:Gem::Version
4
+ hash: 27
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 1
9
+ - 0
10
+ version: 0.1.0
11
+ platform: ruby
12
+ authors:
13
+ - steflewandowski
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2011-01-15 00:00:00 +00:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ requirement: &id001 !ruby/object:Gem::Requirement
23
+ none: false
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ hash: 3
28
+ segments:
29
+ - 0
30
+ version: "0"
31
+ type: :runtime
32
+ name: hashie
33
+ prerelease: false
34
+ version_requirements: *id001
35
+ - !ruby/object:Gem::Dependency
36
+ requirement: &id002 !ruby/object:Gem::Requirement
37
+ none: false
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ hash: 3
42
+ segments:
43
+ - 0
44
+ version: "0"
45
+ type: :runtime
46
+ name: weary
47
+ prerelease: false
48
+ version_requirements: *id002
49
+ - !ruby/object:Gem::Dependency
50
+ requirement: &id003 !ruby/object:Gem::Requirement
51
+ none: false
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ hash: 3
56
+ segments:
57
+ - 0
58
+ version: "0"
59
+ type: :runtime
60
+ name: nokogiri
61
+ prerelease: false
62
+ version_requirements: *id003
63
+ - !ruby/object:Gem::Dependency
64
+ requirement: &id004 !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ~>
68
+ - !ruby/object:Gem::Version
69
+ hash: 23
70
+ segments:
71
+ - 1
72
+ - 0
73
+ - 0
74
+ version: 1.0.0
75
+ type: :development
76
+ name: bundler
77
+ prerelease: false
78
+ version_requirements: *id004
79
+ - !ruby/object:Gem::Dependency
80
+ requirement: &id005 !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ~>
84
+ - !ruby/object:Gem::Version
85
+ hash: 7
86
+ segments:
87
+ - 1
88
+ - 5
89
+ - 2
90
+ version: 1.5.2
91
+ type: :development
92
+ name: jeweler
93
+ prerelease: false
94
+ version_requirements: *id005
95
+ - !ruby/object:Gem::Dependency
96
+ requirement: &id006 !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ">="
100
+ - !ruby/object:Gem::Version
101
+ hash: 3
102
+ segments:
103
+ - 0
104
+ version: "0"
105
+ type: :development
106
+ name: rcov
107
+ prerelease: false
108
+ version_requirements: *id006
109
+ - !ruby/object:Gem::Dependency
110
+ requirement: &id007 !ruby/object:Gem::Requirement
111
+ none: false
112
+ requirements:
113
+ - - ">="
114
+ - !ruby/object:Gem::Version
115
+ hash: 3
116
+ segments:
117
+ - 0
118
+ version: "0"
119
+ type: :runtime
120
+ name: nokogiri
121
+ prerelease: false
122
+ version_requirements: *id007
123
+ - !ruby/object:Gem::Dependency
124
+ requirement: &id008 !ruby/object:Gem::Requirement
125
+ none: false
126
+ requirements:
127
+ - - ">="
128
+ - !ruby/object:Gem::Version
129
+ hash: 3
130
+ segments:
131
+ - 0
132
+ version: "0"
133
+ type: :runtime
134
+ name: hashie
135
+ prerelease: false
136
+ version_requirements: *id008
137
+ - !ruby/object:Gem::Dependency
138
+ requirement: &id009 !ruby/object:Gem::Requirement
139
+ none: false
140
+ requirements:
141
+ - - ">="
142
+ - !ruby/object:Gem::Version
143
+ hash: 3
144
+ segments:
145
+ - 0
146
+ version: "0"
147
+ type: :runtime
148
+ name: weary
149
+ prerelease: false
150
+ version_requirements: *id009
151
+ - !ruby/object:Gem::Dependency
152
+ requirement: &id010 !ruby/object:Gem::Requirement
153
+ none: false
154
+ requirements:
155
+ - - ">="
156
+ - !ruby/object:Gem::Version
157
+ hash: 3
158
+ segments:
159
+ - 0
160
+ version: "0"
161
+ type: :development
162
+ name: rspec
163
+ prerelease: false
164
+ version_requirements: *id010
165
+ description: Simple access to the CultureGrid API
166
+ email: stef@stef.io
167
+ executables: []
168
+
169
+ extensions: []
170
+
171
+ extra_rdoc_files:
172
+ - LICENSE.txt
173
+ files:
174
+ - Gemfile
175
+ - Gemfile.lock
176
+ - LICENSE.txt
177
+ - Rakefile
178
+ - VERSION
179
+ - lib/culturegrid.rb
180
+ - readme.md
181
+ - spec/culturegrid_spec.rb
182
+ - spec/example_response.xml
183
+ - spec/spec_helper.rb
184
+ has_rdoc: true
185
+ homepage: http://github.com/stefl/culturegrid
186
+ licenses:
187
+ - MIT
188
+ post_install_message:
189
+ rdoc_options: []
190
+
191
+ require_paths:
192
+ - lib
193
+ required_ruby_version: !ruby/object:Gem::Requirement
194
+ none: false
195
+ requirements:
196
+ - - ">="
197
+ - !ruby/object:Gem::Version
198
+ hash: 3
199
+ segments:
200
+ - 0
201
+ version: "0"
202
+ required_rubygems_version: !ruby/object:Gem::Requirement
203
+ none: false
204
+ requirements:
205
+ - - ">="
206
+ - !ruby/object:Gem::Version
207
+ hash: 3
208
+ segments:
209
+ - 0
210
+ version: "0"
211
+ requirements: []
212
+
213
+ rubyforge_project:
214
+ rubygems_version: 1.3.7
215
+ signing_key:
216
+ specification_version: 3
217
+ summary: Simple access to the CultureGrid API
218
+ test_files:
219
+ - spec/culturegrid_spec.rb
220
+ - spec/spec_helper.rb