bento_search 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +6 -5
- data/app/assets/javascripts/bento_search/ajax_load.js +42 -16
- data/app/assets/stylesheets/bento_search/suggested_styles.css +9 -0
- data/app/controllers/bento_search/search_controller.rb +15 -6
- data/app/helpers/bento_search_helper.rb +24 -8
- data/app/item_decorators/bento_search/no_links.rb +13 -0
- data/app/models/bento_search/openurl_creator.rb +18 -8
- data/app/models/bento_search/registrar.rb +2 -6
- data/app/models/bento_search/result_item.rb +43 -3
- data/app/models/bento_search/results.rb +4 -0
- data/app/models/bento_search/search_engine.rb +25 -23
- data/app/search_engines/bento_search/ebsco_host_engine.rb +42 -17
- data/app/search_engines/bento_search/google_books_engine.rb +2 -0
- data/app/search_engines/bento_search/google_site_search_engine.rb +177 -0
- data/app/search_engines/bento_search/mock_engine.rb +5 -0
- data/app/search_engines/bento_search/primo_engine.rb +23 -2
- data/app/search_engines/bento_search/scopus_engine.rb +4 -1
- data/app/search_engines/bento_search/summon_engine.rb +4 -14
- data/app/search_engines/bento_search/worldcat_sru_dc_engine.rb +293 -0
- data/app/views/bento_search/_std_item.html.erb +4 -5
- data/app/views/bento_search/_wrap_with_count.html.erb +20 -0
- data/app/views/bento_search/search/search.html.erb +15 -1
- data/config/locales/en.yml +6 -4
- data/lib/bento_search/util.rb +13 -0
- data/lib/bento_search/version.rb +1 -1
- data/test/dummy/log/development.log +1 -0
- data/test/dummy/log/test.log +24357 -0
- data/test/functional/bento_search/search_controller_test.rb +39 -0
- data/test/helper/bento_search_helper_test.rb +47 -5
- data/test/unit/ebsco_host_engine_test.rb +15 -0
- data/test/unit/google_books_engine_test.rb +1 -0
- data/test/unit/google_site_search_test.rb +122 -0
- data/test/unit/item_decorators_test.rb +12 -1
- data/test/unit/openurl_creator_test.rb +19 -3
- data/test/unit/primo_engine_test.rb +5 -3
- data/test/unit/result_item_test.rb +36 -1
- data/test/unit/search_engine_test.rb +27 -4
- data/test/unit/worldcat_sru_dc_engine_test.rb +120 -0
- data/test/vcr_cassettes/google_site/basic_smoke_test.yml +254 -0
- data/test/vcr_cassettes/google_site/empty_result_set.yml +53 -0
- data/test/vcr_cassettes/google_site/pagination_object_is_correct_for_actual_page_when_you_ask_for_too_far.yml +260 -0
- data/test/vcr_cassettes/google_site/with_highlighting.yml +265 -0
- data/test/vcr_cassettes/google_site/without_highlighting.yml +267 -0
- data/test/vcr_cassettes/primo/proper_tags_for_snippets.yml +517 -502
- data/test/vcr_cassettes/primo/search_smoke_test.yml +1 -1
- data/test/vcr_cassettes/worldcat_sru_dc/smoke_test.yml +628 -0
- metadata +40 -4
@@ -15,9 +15,14 @@ class SearchEngineTest < ActiveSupport::TestCase
|
|
15
15
|
assert_equal "required key", engine.configuration.top.next
|
16
16
|
end
|
17
17
|
|
18
|
-
|
19
|
-
|
20
|
-
|
18
|
+
test "nested configuration with hash" do
|
19
|
+
# possible bug in Confstruct make sure we're working around
|
20
|
+
# if needed.
|
21
|
+
# https://github.com/mbklein/confstruct/issues/14
|
22
|
+
engine = MockEngine.new("top" => {"one" => "two"})
|
23
|
+
|
24
|
+
assert_equal "two", engine.configuration.top.one
|
25
|
+
end
|
21
26
|
|
22
27
|
test "nested required config key" do
|
23
28
|
requires_class = Class.new(MockEngine) do
|
@@ -41,7 +46,6 @@ class SearchEngineTest < ActiveSupport::TestCase
|
|
41
46
|
assert_nothing_raised do
|
42
47
|
requires_class.new(:required => {:key => "foo"})
|
43
48
|
end
|
44
|
-
|
45
49
|
end
|
46
50
|
|
47
51
|
test "merges default configuration" do
|
@@ -98,5 +102,24 @@ class SearchEngineTest < ActiveSupport::TestCase
|
|
98
102
|
assert_present pagination.count_records
|
99
103
|
|
100
104
|
end
|
105
|
+
|
106
|
+
test "has empty :for_display config" do
|
107
|
+
engine = MockEngine.new
|
108
|
+
|
109
|
+
assert_not_nil engine.configuration.for_display
|
110
|
+
end
|
111
|
+
|
112
|
+
|
113
|
+
test "carries display configuration over to results" do
|
114
|
+
engine = MockEngine.new(:id => "foo",
|
115
|
+
:for_display => {:foo => "bar", :nested => {"one" => "two"}}
|
116
|
+
)
|
117
|
+
|
118
|
+
results = engine.search("foo")
|
119
|
+
|
120
|
+
assert_present results.display_configuration
|
121
|
+
assert_present results.display_configuration.foo
|
122
|
+
assert_present results.display_configuration.nested.one
|
123
|
+
end
|
101
124
|
|
102
125
|
end
|
@@ -0,0 +1,120 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
require 'cgi'
|
4
|
+
require 'uri'
|
5
|
+
|
6
|
+
#
|
7
|
+
#
|
8
|
+
# Using the MARCXML response is way too much work, but the XML 'DC' response
|
9
|
+
# is awfully stunted. We do what we can with it, but resulting metadata
|
10
|
+
# is weird.
|
11
|
+
#
|
12
|
+
class WorldcatSruDcEngineTest < ActiveSupport::TestCase
|
13
|
+
extend TestWithCassette
|
14
|
+
|
15
|
+
@@api_key = ENV["WORLDCAT_API_KEY"] || "DUMMY_API_KEY"
|
16
|
+
|
17
|
+
VCR.configure do |c|
|
18
|
+
c.filter_sensitive_data("DUMMY_API_KEY", :worldcat_sru_dc) { @@api_key }
|
19
|
+
end
|
20
|
+
|
21
|
+
|
22
|
+
def setup
|
23
|
+
@config = {:api_key => @@api_key}
|
24
|
+
@engine = BentoSearch::WorldcatSruDcEngine.new(@config)
|
25
|
+
end
|
26
|
+
|
27
|
+
def test_construct_url
|
28
|
+
query = 'cancer\'s "one two"'
|
29
|
+
url = @engine.construct_query_url(:query => query, :per_page => 10)
|
30
|
+
|
31
|
+
query_hash = CGI.parse(URI.parse(url).query)
|
32
|
+
|
33
|
+
assert_equal [@engine.configuration.api_key], query_hash["wskey"]
|
34
|
+
assert_equal ['info:srw/schema/1/dc'], query_hash["recordSchema"]
|
35
|
+
assert_equal [@engine.construct_cql_query(:query => query)], query_hash["query"]
|
36
|
+
end
|
37
|
+
|
38
|
+
def test_construct_pagination
|
39
|
+
url = @engine.construct_query_url(:query => "cancer", :per_page => 20, :start => 20)
|
40
|
+
|
41
|
+
query_hash = CGI.parse(URI.parse(url).query)
|
42
|
+
|
43
|
+
assert_equal ["20"], query_hash["maximumRecords"]
|
44
|
+
assert_equal ["21"], query_hash["startRecord"]
|
45
|
+
end
|
46
|
+
|
47
|
+
def test_construct_sort
|
48
|
+
url = @engine.construct_query_url(:query => "cancer", :sort => "date_desc")
|
49
|
+
|
50
|
+
query_hash = CGI.parse(URI.parse(url).query)
|
51
|
+
|
52
|
+
assert_present query_hash["sortKeys"]
|
53
|
+
end
|
54
|
+
|
55
|
+
def test_construct_fielded_search
|
56
|
+
cql = @engine.construct_cql_query(:query => "cancer", :search_field => "srw.ti")
|
57
|
+
|
58
|
+
assert_equal 'srw.ti = "cancer"', cql
|
59
|
+
end
|
60
|
+
|
61
|
+
def test_construct_servicelevel
|
62
|
+
url = @engine.construct_query_url(:query => "cancer")
|
63
|
+
query_hash = CGI.parse(URI.parse(url).query)
|
64
|
+
assert_not_include query_hash["servicelevel"], "full"
|
65
|
+
|
66
|
+
url = @engine.construct_query_url(:query => "cancer auth", :auth => true)
|
67
|
+
query_hash = CGI.parse(URI.parse(url).query)
|
68
|
+
assert_include query_hash["servicelevel"], "full"
|
69
|
+
|
70
|
+
default_on = BentoSearch::WorldcatSruDcEngine.new(@config.merge(:auth => true))
|
71
|
+
|
72
|
+
url = default_on.construct_query_url(:query => "cancer")
|
73
|
+
query_hash = CGI.parse(URI.parse(url).query)
|
74
|
+
assert_include query_hash["servicelevel"], "full"
|
75
|
+
|
76
|
+
url = default_on.construct_query_url(:query => "cancer", :auth => false)
|
77
|
+
query_hash = CGI.parse(URI.parse(url).query)
|
78
|
+
assert_not_include query_hash["servicelevel"], "full"
|
79
|
+
end
|
80
|
+
|
81
|
+
def test_construct_cql
|
82
|
+
# test proper escaping and such
|
83
|
+
cql = @engine.construct_cql_query(:query => "alpha's beta \"one two\" thr\"ee")
|
84
|
+
|
85
|
+
components = cql.split(" AND ")
|
86
|
+
|
87
|
+
assert_equal 4, components.length
|
88
|
+
|
89
|
+
["srw.kw = \"beta\"",
|
90
|
+
"srw.kw = \"alpha's\"",
|
91
|
+
"srw.kw = \"one two\"",
|
92
|
+
"srw.kw = \"thr\\\"ee\""].each do |clause|
|
93
|
+
assert_include components, clause
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
test_with_cassette("smoke test", :worldcat_sru_dc) do
|
98
|
+
results = @engine.search("anarchism")
|
99
|
+
|
100
|
+
assert_present results
|
101
|
+
|
102
|
+
assert_present results.total_items
|
103
|
+
|
104
|
+
first = results.first
|
105
|
+
|
106
|
+
assert_present first.title
|
107
|
+
assert_present first.authors
|
108
|
+
assert_present first.publisher
|
109
|
+
assert_present first.oclcnum
|
110
|
+
|
111
|
+
assert_present first.year
|
112
|
+
|
113
|
+
assert_present first.abstract
|
114
|
+
|
115
|
+
assert_present first.link
|
116
|
+
|
117
|
+
assert_present first.language_code
|
118
|
+
end
|
119
|
+
|
120
|
+
end
|
@@ -0,0 +1,254 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://www.googleapis.com/customsearch/v1?cx=DUMMY_CX&key=DUMMY_API_KEY&num=10&q=books
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers: {}
|
10
|
+
response:
|
11
|
+
status:
|
12
|
+
code: 200
|
13
|
+
message: OK
|
14
|
+
headers:
|
15
|
+
Expires:
|
16
|
+
- Wed, 05 Sep 2012 16:17:48 GMT
|
17
|
+
Date:
|
18
|
+
- Wed, 05 Sep 2012 16:17:48 GMT
|
19
|
+
Cache-Control:
|
20
|
+
- private, max-age=0, must-revalidate, no-transform
|
21
|
+
Etag:
|
22
|
+
- ! '"LXj_4NvXMsBuBj8xNRXBhULBOPo/gICCjBJk8zfraPhwFfSYwpHaKAM"'
|
23
|
+
Content-Type:
|
24
|
+
- application/json; charset=UTF-8
|
25
|
+
X-Content-Type-Options:
|
26
|
+
- nosniff
|
27
|
+
X-Frame-Options:
|
28
|
+
- SAMEORIGIN
|
29
|
+
X-Xss-Protection:
|
30
|
+
- 1; mode=block
|
31
|
+
Server:
|
32
|
+
- GSE
|
33
|
+
Transfer-Encoding:
|
34
|
+
- chunked
|
35
|
+
body:
|
36
|
+
encoding: UTF-8
|
37
|
+
string: ! "{\n \"kind\": \"customsearch#search\",\n \"url\": {\n \"type\":
|
38
|
+
\"application/json\",\n \"template\": \"https://www.googleapis.com/customsearch/v1?q={searchTerms}&num={count?}&start={startIndex?}&lr={language?}&safe={safe?}&cx={cx?}&cref={cref?}&sort={sort?}&filter={filter?}&gl={gl?}&cr={cr?}&googlehost={googleHost?}&c2coff={disableCnTwTranslation?}&hq={hq?}&hl={hl?}&siteSearch={siteSearch?}&siteSearchFilter={siteSearchFilter?}&exactTerms={exactTerms?}&excludeTerms={excludeTerms?}&linkSite={linkSite?}&orTerms={orTerms?}&relatedSite={relatedSite?}&dateRestrict={dateRestrict?}&lowRange={lowRange?}&highRange={highRange?}&searchType={searchType}&fileType={fileType?}&rights={rights?}&imgSize={imgSize?}&imgType={imgType?}&imgColorType={imgColorType?}&imgDominantColor={imgDominantColor?}&alt=json\"\n
|
39
|
+
},\n \"queries\": {\n \"nextPage\": [\n {\n \"title\": \"Google Custom
|
40
|
+
Search - books\",\n \"totalResults\": \"6950\",\n \"searchTerms\": \"books\",\n
|
41
|
+
\ \"count\": 10,\n \"startIndex\": 11,\n \"inputEncoding\": \"utf8\",\n
|
42
|
+
\ \"outputEncoding\": \"utf8\",\n \"safe\": \"off\",\n \"cx\": \"DUMMY_CX\"\n
|
43
|
+
\ }\n ],\n \"request\": [\n {\n \"title\": \"Google Custom Search
|
44
|
+
- books\",\n \"totalResults\": \"6950\",\n \"searchTerms\": \"books\",\n
|
45
|
+
\ \"count\": 10,\n \"startIndex\": 1,\n \"inputEncoding\": \"utf8\",\n
|
46
|
+
\ \"outputEncoding\": \"utf8\",\n \"safe\": \"off\",\n \"cx\": \"DUMMY_CX\"\n
|
47
|
+
\ }\n ]\n },\n \"context\": {\n \"title\": \"JHU Libraries test\"\n },\n
|
48
|
+
\"searchInformation\": {\n \"searchTime\": 0.262793,\n \"formattedSearchTime\":
|
49
|
+
\"0.26\",\n \"totalResults\": \"6950\",\n \"formattedTotalResults\": \"6,950\"\n
|
50
|
+
},\n \"items\": [\n {\n \"kind\": \"customsearch#result\",\n \"title\":
|
51
|
+
\"Rare Books and Manuscripts\",\n \"htmlTitle\": \"Rare \\u003cb\\u003eBooks\\u003c/b\\u003e
|
52
|
+
and Manuscripts\",\n \"link\": \"http://www.library.jhu.edu/collections/specialcollections/index.html\",\n
|
53
|
+
\ \"displayLink\": \"www.library.jhu.edu\",\n \"snippet\": \"Main page
|
54
|
+
for the Special Collections Department of Archives, Manuscripts and Rare
|
55
|
+
Books.\",\n \"htmlSnippet\": \"Main page for the Special Collections Department
|
56
|
+
of Archives, Manuscripts and \\u003cbr\\u003e Rare \\u003cb\\u003eBooks\\u003c/b\\u003e.\",\n
|
57
|
+
\ \"cacheId\": \"2KLFAzsCxMsJ\",\n \"formattedUrl\": \"www.library.jhu.edu/collections/specialcollections/index.html\",\n
|
58
|
+
\ \"htmlFormattedUrl\": \"www.library.jhu.edu/collections/specialcollections/index.html\",\n
|
59
|
+
\ \"pagemap\": {\n \"cse_image\": [\n {\n \"src\": \"http://old.library.jhu.edu/sebin/t/t/gpl_library_smaller.jpg\"\n
|
60
|
+
\ }\n ],\n \"cse_thumbnail\": [\n {\n \"width\": \"200\",\n
|
61
|
+
\ \"height\": \"252\",\n \"src\": \"https://encrypted-tbn0.google.com/images?q=tbn:ANd9GcTgARgvj5T5jta3XN9ZLZzd30pqVZetCQ-JM-AHnXp_BEvMvJjA6WiYJjSB\"\n
|
62
|
+
\ }\n ],\n \"metatags\": [\n {\n \"author\": \"Holly Callahan\",\n
|
63
|
+
\ \"date\": \"2011-11-28T16:17:48-04:00\",\n \"title\": \"Home\"\n
|
64
|
+
\ }\n ]\n }\n },\n {\n \"kind\": \"customsearch#result\",\n \"title\":
|
65
|
+
\"JHSearch: Safari Books Online\",\n \"htmlTitle\": \"JHSearch: Safari \\u003cb\\u003eBooks\\u003c/b\\u003e
|
66
|
+
Online\",\n \"link\": \"http://jhsearch.library.jhu.edu/databases/database/JHU03821\",\n
|
67
|
+
\ \"displayLink\": \"jhsearch.library.jhu.edu\",\n \"snippet\": \"Safari
|
68
|
+
Books Online is a joint venture of O'Reilly Media and The Pearson Technology
|
69
|
+
Group that compiles the best technology books from the leading authors ...\",\n
|
70
|
+
\ \"htmlSnippet\": \"Safari \\u003cb\\u003eBooks\\u003c/b\\u003e Online is
|
71
|
+
a joint venture of O'Reilly Media and The Pearson \\u003cbr\\u003e Technology
|
72
|
+
Group that compiles the best technology \\u003cb\\u003ebooks\\u003c/b\\u003e
|
73
|
+
from the leading \\u003cbr\\u003e authors \\u003cb\\u003e...\\u003c/b\\u003e\",\n
|
74
|
+
\ \"cacheId\": \"xQzMfZhyB-EJ\",\n \"formattedUrl\": \"jhsearch.library.jhu.edu/databases/database/JHU03821\",\n
|
75
|
+
\ \"htmlFormattedUrl\": \"jhsearch.library.jhu.edu/databases/database/JHU03821\"\n
|
76
|
+
\ },\n {\n \"kind\": \"customsearch#result\",\n \"title\": \"Peabody
|
77
|
+
Library - Special Collections & Archives - Library Guides at ...\",\n \"htmlTitle\":
|
78
|
+
\"Peabody Library - Special Collections & Archives - Library Guides at
|
79
|
+
\\u003cb\\u003e...\\u003c/b\\u003e\",\n \"link\": \"http://www.library.jhu.edu/collections/specialcollections/rarebooks/peabody/\",\n
|
80
|
+
\ \"displayLink\": \"www.library.jhu.edu\",\n \"snippet\": \"Aug 22, 2012
|
81
|
+
... How to Request MaterialsRare Books and Manuscripts Polices · How-To: A
|
82
|
+
\ History of Instruction (Archibald) · Book FestivalFlower Mart ...\",\n
|
83
|
+
\ \"htmlSnippet\": \"Aug 22, 2012 \\u003cb\\u003e...\\u003c/b\\u003e How
|
84
|
+
to Request MaterialsRare \\u003cb\\u003eBooks\\u003c/b\\u003e and Manuscripts
|
85
|
+
Polices · How-To: A \\u003cbr\\u003e History of Instruction (Archibald)
|
86
|
+
· \\u003cb\\u003eBook\\u003c/b\\u003e FestivalFlower Mart \\u003cb\\u003e...\\u003c/b\\u003e\",\n
|
87
|
+
\ \"formattedUrl\": \"www.library.jhu.edu/collections/specialcollections/rarebooks/peabody/\",\n
|
88
|
+
\ \"htmlFormattedUrl\": \"www.library.jhu.edu/collections/specialcollections/rare\\u003cb\\u003ebooks\\u003c/b\\u003e/peabody/\",\n
|
89
|
+
\ \"pagemap\": {\n \"metatags\": [\n {\n \"author\": \"Heidi
|
90
|
+
Herr, Chella Vaidyanathan, Jordon Steele\",\n \"copyright\": \"Copyright
|
91
|
+
Johns Hopkins University 2012\",\n \"dc.title\": \"Library Guides. Special
|
92
|
+
Collections & Archives. Peabody Library.\",\n \"dc.creator\": \"Heidi
|
93
|
+
Herr, Chella Vaidyanathan, Jordon Steele\",\n \"dc.subject\": \"Peabody
|
94
|
+
Library Special Collections & Archives Library Guides\",\n \"dc.description\":
|
95
|
+
\"Information about the exquisite Peabody Library\",\n \"dc.publisher\":
|
96
|
+
\"Johns Hopkins University Sheridan Libraries\",\n \"dc.rights\": \"Copyright
|
97
|
+
Johns Hopkins University 2012\",\n \"dc.language\": \"en\",\n \"dc.identifier\":
|
98
|
+
\"http://guides.library.jhu.edu/specialcollections\",\n \"dc.date.created\":
|
99
|
+
\"Aug 25, 2011\",\n \"dc.date.modified\": \"Aug 22, 2012\",\n \"dc.unused\":
|
100
|
+
\"Contributor, Date, Type, Format, Source, Relation, Coverage\",\n \"y_key\":
|
101
|
+
\"65baedbaee9038f3\"\n }\n ]\n }\n },\n {\n \"kind\": \"customsearch#result\",\n
|
102
|
+
\ \"title\": \"Books - German Language and Literature - Library Guides at
|
103
|
+
Johns ...\",\n \"htmlTitle\": \"\\u003cb\\u003eBooks\\u003c/b\\u003e - German
|
104
|
+
Language and Literature - Library Guides at Johns \\u003cb\\u003e...\\u003c/b\\u003e\",\n
|
105
|
+
\ \"link\": \"http://guides.library.jhu.edu/content.php?pid=25138&sid=181188\",\n
|
106
|
+
\ \"displayLink\": \"guides.library.jhu.edu\",\n \"snippet\": \"Aug 8,
|
107
|
+
2012 ... Arbeitsgemeinschaft Sammlung Deutscher Drucke: 6 libraries are reconstructing
|
108
|
+
\ a national bibliography that will cover the German prints from ...\",\n
|
109
|
+
\ \"htmlSnippet\": \"Aug 8, 2012 \\u003cb\\u003e...\\u003c/b\\u003e Arbeitsgemeinschaft
|
110
|
+
Sammlung Deutscher Drucke: 6 libraries are reconstructing \\u003cbr\\u003e
|
111
|
+
\ a national bibliography that will cover the German prints from \\u003cb\\u003e...\\u003c/b\\u003e\",\n
|
112
|
+
\ \"formattedUrl\": \"guides.library.jhu.edu/content.php?pid=25138&sid=181188\",\n
|
113
|
+
\ \"htmlFormattedUrl\": \"guides.library.jhu.edu/content.php?pid=25138&sid=181188\",\n
|
114
|
+
\ \"pagemap\": {\n \"metatags\": [\n {\n \"author\": \"Sue Waterman\",\n
|
115
|
+
\ \"copyright\": \"Copyright Johns Hopkins University 2012\",\n \"dc.title\":
|
116
|
+
\"Library Guides. German Language and Literature. Books.\",\n \"dc.creator\":
|
117
|
+
\"Sue Waterman\",\n \"dc.subject\": \"Books German Language and Literature
|
118
|
+
Library Guides\",\n \"dc.description\": \"Resources, both online and
|
119
|
+
elsewhere, for the German language and literature.\",\n \"dc.publisher\":
|
120
|
+
\"Johns Hopkins University Sheridan Libraries\",\n \"dc.rights\": \"Copyright
|
121
|
+
Johns Hopkins University 2012\",\n \"dc.language\": \"en\",\n \"dc.identifier\":
|
122
|
+
\"http://guides.library.jhu.edu/german\",\n \"dc.date.created\": \"Nov
|
123
|
+
6, 2008\",\n \"dc.date.modified\": \"Aug 8, 2012\",\n \"dc.unused\":
|
124
|
+
\"Contributor, Date, Type, Format, Source, Relation, Coverage\",\n \"y_key\":
|
125
|
+
\"65baedbaee9038f3\"\n }\n ]\n }\n },\n {\n \"kind\": \"customsearch#result\",\n
|
126
|
+
\ \"title\": \"Out of Copyright Books\",\n \"htmlTitle\": \"Out of Copyright
|
127
|
+
\\u003cb\\u003eBooks\\u003c/b\\u003e\",\n \"link\": \"https://jscholarship.library.jhu.edu/handle/1774.2/59\",\n
|
128
|
+
\ \"displayLink\": \"jscholarship.library.jhu.edu\",\n \"snippet\": \"This
|
129
|
+
collection contains content captured during preservation reformatting of materials
|
130
|
+
from the physical collection. There is usually a bibliographic record in the
|
131
|
+
...\",\n \"htmlSnippet\": \"This collection contains content captured during
|
132
|
+
preservation reformatting of \\u003cbr\\u003e materials from the physical
|
133
|
+
collection. There is usually a bibliographic record in \\u003cbr\\u003e the
|
134
|
+
\\u003cb\\u003e...\\u003c/b\\u003e\",\n \"cacheId\": \"SK7ab5EIgAAJ\",\n
|
135
|
+
\ \"formattedUrl\": \"https://jscholarship.library.jhu.edu/handle/1774.2/59\",\n
|
136
|
+
\ \"htmlFormattedUrl\": \"https://jscholarship.library.jhu.edu/handle/1774.2/59\",\n
|
137
|
+
\ \"pagemap\": {\n \"cse_image\": [\n {\n \"src\": \"https://jscholarship.library.jhu.edu/themes/Golden/logo.png\"\n
|
138
|
+
\ }\n ],\n \"cse_thumbnail\": [\n {\n \"width\": \"101\",\n
|
139
|
+
\ \"height\": \"98\",\n \"src\": \"https://encrypted-tbn2.google.com/images?q=tbn:ANd9GcTEyucbV5j6Fw-ZfWJxayVmiWAg9JunzletDcmf0gi22lrYi-ZsgvDV2A\"\n
|
140
|
+
\ }\n ]\n }\n },\n {\n \"kind\": \"customsearch#result\",\n \"title\":
|
141
|
+
\"Books - French Language and Literature - Library Guides at Johns ...\",\n
|
142
|
+
\ \"htmlTitle\": \"\\u003cb\\u003eBooks\\u003c/b\\u003e - French Language
|
143
|
+
and Literature - Library Guides at Johns \\u003cb\\u003e...\\u003c/b\\u003e\",\n
|
144
|
+
\ \"link\": \"http://guides.library.jhu.edu/content.php?pid=22748&sid=165198\",\n
|
145
|
+
\ \"displayLink\": \"guides.library.jhu.edu\",\n \"snippet\": \"Aug 2,
|
146
|
+
2012 ... Checking out, Renewing, Recalling BooksComputing in the libraryConnecting
|
147
|
+
\ from off-campusFind an article onlineFind Films and DVD'sHow ...\",\n \"htmlSnippet\":
|
148
|
+
\"Aug 2, 2012 \\u003cb\\u003e...\\u003c/b\\u003e Checking out, Renewing, Recalling
|
149
|
+
\\u003cb\\u003eBooks\\u003c/b\\u003eComputing in the libraryConnecting \\u003cbr\\u003e
|
150
|
+
\ from off-campusFind an article onlineFind Films and DVD'sHow \\u003cb\\u003e...\\u003c/b\\u003e\",\n
|
151
|
+
\ \"formattedUrl\": \"guides.library.jhu.edu/content.php?pid=22748&sid=165198\",\n
|
152
|
+
\ \"htmlFormattedUrl\": \"guides.library.jhu.edu/content.php?pid=22748&sid=165198\",\n
|
153
|
+
\ \"pagemap\": {\n \"metatags\": [\n {\n \"author\": \"Sue Waterman\",\n
|
154
|
+
\ \"copyright\": \"Copyright Johns Hopkins University 2012\",\n \"dc.title\":
|
155
|
+
\"Library Guides. French Language and Literature. Books.\",\n \"dc.creator\":
|
156
|
+
\"Sue Waterman\",\n \"dc.subject\": \"Books French Language and Literature
|
157
|
+
Library Guides\",\n \"dc.description\": \"Resources, both online and
|
158
|
+
elsewhere, for the French language and literature.\",\n \"dc.publisher\":
|
159
|
+
\"Johns Hopkins University Sheridan Libraries\",\n \"dc.rights\": \"Copyright
|
160
|
+
Johns Hopkins University 2012\",\n \"dc.language\": \"en\",\n \"dc.identifier\":
|
161
|
+
\"http://guides.library.jhu.edu/french\",\n \"dc.date.created\": \"Nov
|
162
|
+
5, 2008\",\n \"dc.date.modified\": \"Aug 2, 2012\",\n \"dc.unused\":
|
163
|
+
\"Contributor, Date, Type, Format, Source, Relation, Coverage\",\n \"y_key\":
|
164
|
+
\"65baedbaee9038f3\"\n }\n ]\n }\n },\n {\n \"kind\": \"customsearch#result\",\n
|
165
|
+
\ \"title\": \"Home: Intro to E-Books - E-Books - Library Guides at Johns
|
166
|
+
Hopkins ...\",\n \"htmlTitle\": \"Home: Intro to E-\\u003cb\\u003eBooks\\u003c/b\\u003e
|
167
|
+
- E-\\u003cb\\u003eBooks\\u003c/b\\u003e - Library Guides at Johns Hopkins
|
168
|
+
\\u003cb\\u003e...\\u003c/b\\u003e\",\n \"link\": \"http://guides.library.jhu.edu/ebooks\",\n
|
169
|
+
\ \"displayLink\": \"guides.library.jhu.edu\",\n \"snippet\": \"Aug 14,
|
170
|
+
2012 ... How to find electronic books and resources in the library's catalog.\",\n
|
171
|
+
\ \"htmlSnippet\": \"Aug 14, 2012 \\u003cb\\u003e...\\u003c/b\\u003e How
|
172
|
+
to find electronic \\u003cb\\u003ebooks\\u003c/b\\u003e and resources in the
|
173
|
+
library's catalog.\",\n \"formattedUrl\": \"guides.library.jhu.edu/ebooks\",\n
|
174
|
+
\ \"htmlFormattedUrl\": \"guides.library.jhu.edu/e\\u003cb\\u003ebooks\\u003c/b\\u003e\",\n
|
175
|
+
\ \"pagemap\": {\n \"metatags\": [\n {\n \"author\": \"Sue Vazakas\",\n
|
176
|
+
\ \"copyright\": \"Copyright Johns Hopkins University 2012\",\n \"dc.title\":
|
177
|
+
\"Library Guides. E-Books. Home: Intro to E-Books.\",\n \"dc.creator\":
|
178
|
+
\"Sue Vazakas\",\n \"dc.subject\": \"Home: Intro to E-Books E-Books Library
|
179
|
+
Guides\",\n \"dc.description\": \"How to find electronic books and resources
|
180
|
+
in the library's catalog.\",\n \"dc.publisher\": \"Johns Hopkins University
|
181
|
+
Sheridan Libraries\",\n \"dc.rights\": \"Copyright Johns Hopkins University
|
182
|
+
2012\",\n \"dc.language\": \"en\",\n \"dc.identifier\": \"http://guides.library.jhu.edu/ebooks\",\n
|
183
|
+
\ \"dc.date.created\": \"May 9, 2011\",\n \"dc.date.modified\": \"Aug
|
184
|
+
14, 2012\",\n \"dc.unused\": \"Contributor, Date, Type, Format, Source,
|
185
|
+
Relation, Coverage\",\n \"y_key\": \"65baedbaee9038f3\"\n }\n ]\n
|
186
|
+
\ }\n },\n {\n \"kind\": \"customsearch#result\",\n \"title\": \"Finding
|
187
|
+
Books in the JHU Libraries\",\n \"htmlTitle\": \"Finding \\u003cb\\u003eBooks\\u003c/b\\u003e
|
188
|
+
in the JHU Libraries\",\n \"link\": \"http://old.library.jhu.edu/researchhelp/general/books.html\",\n
|
189
|
+
\ \"displayLink\": \"old.library.jhu.edu\",\n \"snippet\": \"Find books
|
190
|
+
that are owned by one of the JHU Libraries. Search the JHU Libraries Catalog
|
191
|
+
for books that are owned by Johns Hopkins, as well as for videos, ...\",\n
|
192
|
+
\ \"htmlSnippet\": \"Find \\u003cb\\u003ebooks\\u003c/b\\u003e that are owned
|
193
|
+
by one of the JHU Libraries. Search the JHU Libraries \\u003cbr\\u003e Catalog
|
194
|
+
for \\u003cb\\u003ebooks\\u003c/b\\u003e that are owned by Johns Hopkins,
|
195
|
+
as well as for videos, \\u003cb\\u003e...\\u003c/b\\u003e\",\n \"cacheId\":
|
196
|
+
\"76s2xASMLHsJ\",\n \"formattedUrl\": \"old.library.jhu.edu/researchhelp/general/books.html\",\n
|
197
|
+
\ \"htmlFormattedUrl\": \"old.library.jhu.edu/researchhelp/general/\\u003cb\\u003ebooks\\u003c/b\\u003e.html\",\n
|
198
|
+
\ \"pagemap\": {\n \"cse_image\": [\n {\n \"src\": \"http://old.library.jhu.edu/sebin/m/t/book.gif\"\n
|
199
|
+
\ }\n ],\n \"cse_thumbnail\": [\n {\n \"width\": \"104\",\n
|
200
|
+
\ \"height\": \"68\",\n \"src\": \"https://encrypted-tbn3.google.com/images?q=tbn:ANd9GcQVuOwr0XQBCzyzOcqWnAHsX2dZINnIoj2z5fKfWRSfXP7j2cY80oTp\"\n
|
201
|
+
\ }\n ],\n \"metatags\": [\n {\n \"author\": \"Andrea Bartelstein\",\n
|
202
|
+
\ \"date\": \"2005-03-01T16:28:07-04:00\",\n \"dc.creator\": \"Andrea
|
203
|
+
Bartelstein\",\n \"title\": \"Finding Books in the JHU Libraries\",\n
|
204
|
+
\ \"dc.title\": \"Finding Books in Education and Counseling\",\n \"dc.keyword\":
|
205
|
+
\"education counseling counselling research help finding books\"\n }\n
|
206
|
+
\ ]\n }\n },\n {\n \"kind\": \"customsearch#result\",\n \"title\":
|
207
|
+
\"3. Downloading E-books - E-Books - Library Guides at Johns ...\",\n \"htmlTitle\":
|
208
|
+
\"3. Downloading E-\\u003cb\\u003ebooks\\u003c/b\\u003e - E-\\u003cb\\u003eBooks\\u003c/b\\u003e
|
209
|
+
- Library Guides at Johns \\u003cb\\u003e...\\u003c/b\\u003e\",\n \"link\":
|
210
|
+
\"http://guides.library.jhu.edu/content.php?pid=156837&sid=1723518\",\n \"displayLink\":
|
211
|
+
\"guides.library.jhu.edu\",\n \"snippet\": \"Aug 14, 2012 ... How to find
|
212
|
+
electronic books and resources in the library's catalog.\",\n \"htmlSnippet\":
|
213
|
+
\"Aug 14, 2012 \\u003cb\\u003e...\\u003c/b\\u003e How to find electronic \\u003cb\\u003ebooks\\u003c/b\\u003e
|
214
|
+
and resources in the library's catalog.\",\n \"formattedUrl\": \"guides.library.jhu.edu/content.php?pid=156837&sid=1723518\",\n
|
215
|
+
\ \"htmlFormattedUrl\": \"guides.library.jhu.edu/content.php?pid=156837&sid=1723518\",\n
|
216
|
+
\ \"pagemap\": {\n \"metatags\": [\n {\n \"author\": \"Sue Vazakas\",\n
|
217
|
+
\ \"copyright\": \"Copyright Johns Hopkins University 2012\",\n \"dc.title\":
|
218
|
+
\"Library Guides. E-Books. 3. Downloading E-books.\",\n \"dc.creator\":
|
219
|
+
\"Sue Vazakas\",\n \"dc.subject\": \"3. Downloading E-books E-Books Library
|
220
|
+
Guides\",\n \"dc.description\": \"How to find electronic books and resources
|
221
|
+
in the library's catalog.\",\n \"dc.publisher\": \"Johns Hopkins University
|
222
|
+
Sheridan Libraries\",\n \"dc.rights\": \"Copyright Johns Hopkins University
|
223
|
+
2012\",\n \"dc.language\": \"en\",\n \"dc.identifier\": \"http://guides.library.jhu.edu/ebooks\",\n
|
224
|
+
\ \"dc.date.created\": \"May 9, 2011\",\n \"dc.date.modified\": \"Aug
|
225
|
+
14, 2012\",\n \"dc.unused\": \"Contributor, Date, Type, Format, Source,
|
226
|
+
Relation, Coverage\",\n \"y_key\": \"65baedbaee9038f3\"\n }\n ]\n
|
227
|
+
\ }\n },\n {\n \"kind\": \"customsearch#result\",\n \"title\": \"Books
|
228
|
+
- Italian Language and Literature - Library Guides at Johns ...\",\n \"htmlTitle\":
|
229
|
+
\"\\u003cb\\u003eBooks\\u003c/b\\u003e - Italian Language and Literature -
|
230
|
+
Library Guides at Johns \\u003cb\\u003e...\\u003c/b\\u003e\",\n \"link\":
|
231
|
+
\"http://guides.library.jhu.edu/content.php?pid=25794&sid=186218\",\n \"displayLink\":
|
232
|
+
\"guides.library.jhu.edu\",\n \"snippet\": \"Aug 15, 2012 ... Checking out,
|
233
|
+
Renewing, Recalling BooksComputing in the libraryConnecting from off-campusFind
|
234
|
+
an article onlineFind Films and DVD'sHow ...\",\n \"htmlSnippet\": \"Aug
|
235
|
+
15, 2012 \\u003cb\\u003e...\\u003c/b\\u003e Checking out, Renewing, Recalling
|
236
|
+
\\u003cb\\u003eBooks\\u003c/b\\u003eComputing in the libraryConnecting \\u003cbr\\u003e
|
237
|
+
\ from off-campusFind an article onlineFind Films and DVD'sHow \\u003cb\\u003e...\\u003c/b\\u003e\",\n
|
238
|
+
\ \"formattedUrl\": \"guides.library.jhu.edu/content.php?pid=25794&sid=186218\",\n
|
239
|
+
\ \"htmlFormattedUrl\": \"guides.library.jhu.edu/content.php?pid=25794&sid=186218\",\n
|
240
|
+
\ \"pagemap\": {\n \"metatags\": [\n {\n \"author\": \"Sue Waterman\",\n
|
241
|
+
\ \"copyright\": \"Copyright Johns Hopkins University 2012\",\n \"dc.title\":
|
242
|
+
\"Library Guides. Italian Language and Literature. Books.\",\n \"dc.creator\":
|
243
|
+
\"Sue Waterman\",\n \"dc.subject\": \"Books Italian Language and Literature
|
244
|
+
Library Guides\",\n \"dc.description\": \"Resources, in all formats,
|
245
|
+
for the study of Italian literature and language\",\n \"dc.publisher\":
|
246
|
+
\"Johns Hopkins University Sheridan Libraries\",\n \"dc.rights\": \"Copyright
|
247
|
+
Johns Hopkins University 2012\",\n \"dc.language\": \"en\",\n \"dc.identifier\":
|
248
|
+
\"http://guides.library.jhu.edu/italian\",\n \"dc.date.created\": \"Nov
|
249
|
+
11, 2008\",\n \"dc.date.modified\": \"Aug 15, 2012\",\n \"dc.unused\":
|
250
|
+
\"Contributor, Date, Type, Format, Source, Relation, Coverage\",\n \"y_key\":
|
251
|
+
\"65baedbaee9038f3\"\n }\n ]\n }\n }\n ]\n}\n"
|
252
|
+
http_version:
|
253
|
+
recorded_at: Wed, 05 Sep 2012 16:17:48 GMT
|
254
|
+
recorded_with: VCR 2.2.4
|
@@ -0,0 +1,53 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://www.googleapis.com/customsearch/v1?cx=DUMMY_CX&key=DUMMY_API_KEY&num=10&q=%22adfa%20lakjdr%20xavier%20aldkfj%2092323kjadf%22
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers: {}
|
10
|
+
response:
|
11
|
+
status:
|
12
|
+
code: 200
|
13
|
+
message: OK
|
14
|
+
headers:
|
15
|
+
Expires:
|
16
|
+
- Wed, 05 Sep 2012 20:47:49 GMT
|
17
|
+
Date:
|
18
|
+
- Wed, 05 Sep 2012 20:47:49 GMT
|
19
|
+
Cache-Control:
|
20
|
+
- private, max-age=0, must-revalidate, no-transform
|
21
|
+
Etag:
|
22
|
+
- ! '"LXj_4NvXMsBuBj8xNRXBhULBOPo/W6k8nbDP-T9StSHXQg5D9u2ieE8"'
|
23
|
+
Content-Type:
|
24
|
+
- application/json; charset=UTF-8
|
25
|
+
X-Content-Type-Options:
|
26
|
+
- nosniff
|
27
|
+
X-Frame-Options:
|
28
|
+
- SAMEORIGIN
|
29
|
+
X-Xss-Protection:
|
30
|
+
- 1; mode=block
|
31
|
+
Server:
|
32
|
+
- GSE
|
33
|
+
Transfer-Encoding:
|
34
|
+
- chunked
|
35
|
+
body:
|
36
|
+
encoding: US-ASCII
|
37
|
+
string: ! "{\n \"kind\": \"customsearch#search\",\n \"url\": {\n \"type\":
|
38
|
+
\"application/json\",\n \"template\": \"https://www.googleapis.com/customsearch/v1?q={searchTerms}&num={count?}&start={startIndex?}&lr={language?}&safe={safe?}&cx={cx?}&cref={cref?}&sort={sort?}&filter={filter?}&gl={gl?}&cr={cr?}&googlehost={googleHost?}&c2coff={disableCnTwTranslation?}&hq={hq?}&hl={hl?}&siteSearch={siteSearch?}&siteSearchFilter={siteSearchFilter?}&exactTerms={exactTerms?}&excludeTerms={excludeTerms?}&linkSite={linkSite?}&orTerms={orTerms?}&relatedSite={relatedSite?}&dateRestrict={dateRestrict?}&lowRange={lowRange?}&highRange={highRange?}&searchType={searchType}&fileType={fileType?}&rights={rights?}&imgSize={imgSize?}&imgType={imgType?}&imgColorType={imgColorType?}&imgDominantColor={imgDominantColor?}&alt=json\"\n
|
39
|
+
},\n \"queries\": {\n \"request\": [\n {\n \"title\": \"Google Custom
|
40
|
+
Search - \\\"adfa lakjdr xavier aldkfj 92323kjadf\\\"\",\n \"totalResults\":
|
41
|
+
\"0\",\n \"searchTerms\": \"\\\"adfa lakjdr xavier aldkfj 92323kjadf\\\"\",\n
|
42
|
+
\ \"count\": 10,\n \"inputEncoding\": \"utf8\",\n \"outputEncoding\":
|
43
|
+
\"utf8\",\n \"safe\": \"off\",\n \"cx\": \"DUMMY_CX\"\n }\n ]\n },\n
|
44
|
+
\"searchInformation\": {\n \"searchTime\": 0.506227,\n \"formattedSearchTime\":
|
45
|
+
\"0.51\",\n \"totalResults\": \"0\",\n \"formattedTotalResults\": \"0\"\n
|
46
|
+
},\n \"spelling\": {\n \"correctedQuery\": \"\\\"adfa lake dr xavier asldkfj
|
47
|
+
92323kj adf\\\"\",\n \"htmlCorrectedQuery\": \""adfa \\u003cb\\u003e\\u003ci\\u003elake
|
48
|
+
dr\\u003c/i\\u003e\\u003c/b\\u003e xavier \\u003cb\\u003e\\u003ci\\u003easldkfj\\u003c/i\\u003e\\u003c/b\\u003e
|
49
|
+
\\u003cb\\u003e\\u003ci\\u003e92323kj adf\\u003c/i\\u003e\\u003c/b\\u003e"\"\n
|
50
|
+
}\n}\n"
|
51
|
+
http_version:
|
52
|
+
recorded_at: Wed, 05 Sep 2012 20:47:49 GMT
|
53
|
+
recorded_with: VCR 2.2.4
|