From 07706035e035331e9db6b518a85f4d7369cc96c0 Mon Sep 17 00:00:00 2001 From: Jeremy Prevost Date: Thu, 1 Sep 2016 16:44:45 -0400 Subject: [PATCH] Allows setting of number of results per box via ENV --- app/models/search_eds.rb | 7 +- app/models/search_google.rb | 6 +- test/models/search_google_test.rb | 4 +- test/vcr_cassettes/google_no_metadata.yml | 184 ++------------- test/vcr_cassettes/google_no_results.yml | 22 +- .../invalid_google_credentials.yml | 4 +- .../valid_google_search_and_credentials.yml | 221 ++---------------- .../valid_search_and_credentials.yml | 2 +- 8 files changed, 56 insertions(+), 394 deletions(-) diff --git a/app/models/search_eds.rb b/app/models/search_eds.rb index 3bd87999..f7b260fc 100644 --- a/app/models/search_eds.rb +++ b/app/models/search_eds.rb @@ -4,6 +4,7 @@ class SearchEds EDS_URL = ENV['EDS_URL'].freeze EDS_NO_ALEPH_PROFILE = ENV['EDS_NO_ALEPH_PROFILE'].freeze EDS_ALEPH_PROFILE = ENV['EDS_ALEPH_PROFILE'].freeze + RESULTS_PER_BOX = ENV['RESULTS_PER_BOX'] || 3 def initialize @auth_token = uid_auth @@ -75,9 +76,9 @@ def relationships(record) def search_url(term) [EDS_URL, '/edsapi/rest/Search?query=', URI.escape(term).to_s, - '&searchmode=all', '&resultsperpage=3', '&pagenumber=1', '&sort=relevance', - '&highlight=n', '&includefacets=n', '&view=brief', - '&autosuggest=n'].join('') + '&searchmode=all', "&resultsperpage=#{RESULTS_PER_BOX}", + '&pagenumber=1', '&sort=relevance', '&highlight=n', '&includefacets=n', + '&view=brief', '&autosuggest=n'].join('') end def search_filtered(term) diff --git a/app/models/search_google.rb b/app/models/search_google.rb index 8337a713..c955d3a1 100644 --- a/app/models/search_google.rb +++ b/app/models/search_google.rb @@ -4,6 +4,9 @@ # - GOOGLE_API_KEY # - GOOGLE_CUSTOM_SEARCH_ID # +# == Optional Environment Variables: +# - RESULTS_PER_BOX +# # == See Also # - https://developers.google.com/custom-search/json-api/v1/overview # - https://github.com/google/google-api-ruby-client @@ -25,7 +28,8 @@ def initialize def search(term) @results['raw_google'] = @service.list_cses( term, - cx: ENV['GOOGLE_CUSTOM_SEARCH_ID'] + cx: ENV['GOOGLE_CUSTOM_SEARCH_ID'], + num: ENV['RESULTS_PER_BOX'] || 3 ) to_result(@results['raw_google']) end diff --git a/test/models/search_google_test.rb b/test/models/search_google_test.rb index ccfd71f3..c4bb92f6 100644 --- a/test/models/search_google_test.rb +++ b/test/models/search_google_test.rb @@ -5,7 +5,7 @@ class SearchGoogleTest < ActiveSupport::TestCase test 'valid google search with valid credentials returns results' do VCR.use_cassette('valid google search and credentials') do query = SearchGoogle.new.search('endnote') - assert_equal(1640, query['total']) + assert_equal(1610, query['total']) end end @@ -69,7 +69,7 @@ class SearchGoogleTest < ActiveSupport::TestCase test 'handles pages with no metadata' do VCR.use_cassette('google no metadata') do query = SearchGoogle.new.search('weather patterns') - assert_equal(87, query['total']) + assert_equal(88, query['total']) end end end diff --git a/test/vcr_cassettes/google_no_metadata.yml b/test/vcr_cassettes/google_no_metadata.yml index a244b86b..a3ae9644 100644 --- a/test/vcr_cassettes/google_no_metadata.yml +++ b/test/vcr_cassettes/google_no_metadata.yml @@ -2,7 +2,7 @@ http_interactions: - request: method: get - uri: https://www.googleapis.com/customsearch/v1?cx=FAKE_GOOGLE_CUSTOM_SEARCH_ID&key=FAKE_GOOGLE_API_KEY&q=weather%20patterns + uri: https://www.googleapis.com/customsearch/v1?cx=FAKE_GOOGLE_CUSTOM_SEARCH_ID&key=FAKE_GOOGLE_API_KEY&num=3&q=weather%20patterns body: encoding: UTF-8 string: '' @@ -16,20 +16,20 @@ http_interactions: Accept-Encoding: - gzip,deflate Date: - - Thu, 01 Sep 2016 15:16:53 GMT + - Fri, 02 Sep 2016 14:15:22 GMT response: status: code: 200 message: OK headers: Expires: - - Thu, 01 Sep 2016 15:16:54 GMT + - Fri, 02 Sep 2016 14:15:22 GMT Date: - - Thu, 01 Sep 2016 15:16:54 GMT + - Fri, 02 Sep 2016 14:15:22 GMT Cache-Control: - private, max-age=0, must-revalidate, no-transform Etag: - - '"ZK6WcJ2_cdL-1Kol5cpaPQsD0mI/WMp671_sR1B2dq8dHaAeU77XQTs"' + - '"ZK6WcJ2_cdL-1Kol5cpaPQsD0mI/fSct5L846Z_KRpoUgA2irLpDinI"' Vary: - Origin - X-Origin @@ -45,8 +45,6 @@ http_interactions: - 1; mode=block Server: - GSE - Alternate-Protocol: - - 443:quic Alt-Svc: - quic=":443"; ma=2592000; v="36,35,34,33,32,31,30" Transfer-Encoding: @@ -64,9 +62,9 @@ http_interactions: "request": [ { "title": "Google Custom Search - weather patterns", - "totalResults": "87", + "totalResults": "88", "searchTerms": "weather patterns", - "count": 10, + "count": 3, "startIndex": 1, "inputEncoding": "utf8", "outputEncoding": "utf8", @@ -77,10 +75,10 @@ http_interactions: "nextPage": [ { "title": "Google Custom Search - weather patterns", - "totalResults": "87", + "totalResults": "88", "searchTerms": "weather patterns", - "count": 10, - "startIndex": 11, + "count": 3, + "startIndex": 4, "inputEncoding": "utf8", "outputEncoding": "utf8", "safe": "off", @@ -92,10 +90,10 @@ http_interactions: "title": "mitlib_test" }, "searchInformation": { - "searchTime": 0.153966, - "formattedSearchTime": "0.15", - "totalResults": "87", - "formattedTotalResults": "87" + "searchTime": 0.333364, + "formattedSearchTime": "0.33", + "totalResults": "88", + "formattedTotalResults": "88" }, "items": [ { @@ -185,161 +183,9 @@ http_interactions: } ] } - }, - { - "kind": "customsearch#result", - "title": "Massachusetts Institute of Technology Reports to the President 1987 ...", - "htmlTitle": "Massachusetts Institute of Technology Reports to the President 1987 ...", - "link": "https://libraries.mit.edu/archives/mithistory/presidents-reports/1988.pdf", - "displayLink": "libraries.mit.edu", - "snippet": "Sep 7, 1989 ... While it is not certain that the weather in the summer of '88 is a ... of seacoast \nproperty, and changes in climate and weather patterns are likely ...", - "htmlSnippet": "Sep 7, 1989 \u003cb\u003e...\u003c/b\u003e While it is not certain that the weather in the summer of '88 is a ... of seacoast \u003cbr\u003e\nproperty, and changes in climate and \u003cb\u003eweather patterns\u003c/b\u003e are likely ...", - "mime": "application/pdf", - "fileFormat": "PDF/Adobe Acrobat", - "formattedUrl": "https://libraries.mit.edu/archives/mithistory/presidents-reports/1988.pdf", - "htmlFormattedUrl": "https://libraries.mit.edu/archives/mithistory/presidents-reports/1988.pdf", - "pagemap": { - "metatags": [ - { - "creationdate": "D:20101217121202-05'00'", - "moddate": "D:20101217121228-05'00'" - } - ] - } - }, - { - "kind": "customsearch#result", - "title": "President's Report Issue, 1958", - "htmlTitle": "President's Report Issue, 1958", - "link": "https://libraries.mit.edu/archives/mithistory/presidents-reports/1958.pdf", - "displayLink": "libraries.mit.edu", - "snippet": "standards of excellence, to set new patterns, to give leadership, and to lift the ..... \nities of large-scale control of weather and climate. The. Physics Department has ...", - "htmlSnippet": "standards of excellence, to set new \u003cb\u003epatterns\u003c/b\u003e, to give leadership, and to lift the ..... \u003cbr\u003e\nities of large-scale control of \u003cb\u003eweather\u003c/b\u003e and climate. The. Physics Department has ...", - "mime": "application/pdf", - "fileFormat": "PDF/Adobe Acrobat", - "formattedUrl": "https://libraries.mit.edu/archives/mithistory/presidents-reports/1958.pdf", - "htmlFormattedUrl": "https://libraries.mit.edu/archives/mithistory/presidents-reports/1958.pdf", - "pagemap": { - "metatags": [ - { - "creationdate": "D:20071230224117-05'00'", - "moddate": "D:20071230224117-05'00'" - } - ] - } - }, - { - "kind": "customsearch#result", - "title": "1974", - "htmlTitle": "1974", - "link": "https://libraries.mit.edu/archives/mithistory/presidents-reports/1974.pdf", - "displayLink": "libraries.mit.edu", - "snippet": "Dec 10, 1973 ... Patterns of Growth and Change -- 1940 to 1973 ...... Earls and Sina and Ms. \nAmacher participated in Visiting Professor Piene's exhibit \"Weather, ...", - "htmlSnippet": "Dec 10, 1973 \u003cb\u003e...\u003c/b\u003e \u003cb\u003ePatterns\u003c/b\u003e of Growth and Change -- 1940 to 1973 ...... Earls and Sina and Ms. \u003cbr\u003e\nAmacher participated in Visiting Professor Piene's exhibit "\u003cb\u003eWeather\u003c/b\u003e, ...", - "mime": "application/pdf", - "fileFormat": "PDF/Adobe Acrobat", - "formattedUrl": "https://libraries.mit.edu/archives/mithistory/presidents-reports/1974.pdf", - "htmlFormattedUrl": "https://libraries.mit.edu/archives/mithistory/presidents-reports/1974.pdf", - "pagemap": { - "metatags": [ - { - "creationdate": "D:20071230234800-05'00'", - "moddate": "D:20071230234800-05'00'" - } - ] - } - }, - { - "kind": "customsearch#result", - "title": "1950", - "htmlTitle": "1950", - "link": "https://libraries.mit.edu/archives/mithistory/presidents-reports/1950.pdf", - "displayLink": "libraries.mit.edu", - "snippet": "heartening endorsement by industry of the pattern of coopera- tion which M. I. T. \n..... Due to weather conditions ...... weather patterns of the northern hemisphere.", - "htmlSnippet": "heartening endorsement by industry of the pattern of coopera- tion which M. I. T. \u003cbr\u003e\n..... Due to weather conditions ...... \u003cb\u003eweather patterns\u003c/b\u003e of the northern hemisphere.", - "mime": "application/pdf", - "fileFormat": "PDF/Adobe Acrobat", - "formattedUrl": "https://libraries.mit.edu/archives/mithistory/presidents-reports/1950.pdf", - "htmlFormattedUrl": "https://libraries.mit.edu/archives/mithistory/presidents-reports/1950.pdf", - "pagemap": { - "metatags": [ - { - "creationdate": "D:20071230222024-05'00'", - "moddate": "D:20071230222024-05'00'" - } - ] - } - }, - { - "kind": "customsearch#result", - "title": "William R. Dickson Oral History Project Interviewer: Susan Crowley ...", - "htmlTitle": "William R. Dickson Oral History Project Interviewer: Susan Crowley ...", - "link": "https://libraries.mit.edu/archives/oral-history-transcripts/dickson-pdf/dickson9feb2005.pdf", - "displayLink": "libraries.mit.edu", - "snippet": "Feb 9, 2005 ... had a weather station on the roof, which had a couple of grade R .... a pattern of \npin pricks in the roll shades that would let in light and yet not ...", - "htmlSnippet": "Feb 9, 2005 \u003cb\u003e...\u003c/b\u003e had a \u003cb\u003eweather\u003c/b\u003e station on the roof, which had a couple of grade R .... a \u003cb\u003epattern\u003c/b\u003e of \u003cbr\u003e\npin pricks in the roll shades that would let in light and yet not ...", - "cacheId": "DImOvYhTuB8J", - "mime": "application/pdf", - "fileFormat": "PDF/Adobe Acrobat", - "formattedUrl": "https://libraries.mit.edu/archives/oral-history.../dickson9feb2005.pdf", - "htmlFormattedUrl": "https://libraries.mit.edu/archives/oral-history.../dickson9feb2005.pdf", - "pagemap": { - "metatags": [ - { - "creationdate": "D:20061003143142-04'00'", - "author": "lbeattie", - "creator": "PScript5.dll Version 5.2.2", - "producer": "Acrobat Distiller 7.0.5 (Windows)", - "moddate": "D:20061003143142-04'00'", - "title": "Microsoft Word - Dickson9Feb2005.doc" - } - ] - } - }, - { - "kind": "customsearch#result", - "title": "1954", - "htmlTitle": "1954", - "link": "https://libraries.mit.edu/archives/mithistory/presidents-reports/1954.pdf", - "displayLink": "libraries.mit.edu", - "snippet": "New England this fall, by a weather radar network of the Cambridge Air Force ... \nto the need for interdepartmental activities and new professional patterns.", - "htmlSnippet": "New England this fall, by a \u003cb\u003eweather\u003c/b\u003e radar network of the Cambridge Air Force ... \u003cbr\u003e\nto the need for interdepartmental activities and new professional \u003cb\u003epatterns\u003c/b\u003e.", - "mime": "application/pdf", - "fileFormat": "PDF/Adobe Acrobat", - "formattedUrl": "https://libraries.mit.edu/archives/mithistory/presidents-reports/1954.pdf", - "htmlFormattedUrl": "https://libraries.mit.edu/archives/mithistory/presidents-reports/1954.pdf", - "pagemap": { - "metatags": [ - { - "creationdate": "D:20071230223356-05'00'", - "moddate": "D:20071230223356-05'00'" - } - ] - } - }, - { - "kind": "customsearch#result", - "title": "1955", - "htmlTitle": "1955", - "link": "https://libraries.mit.edu/archives/mithistory/presidents-reports/1955.pdf", - "displayLink": "libraries.mit.edu", - "snippet": "a new and growing field in which the Department's Weather. Radar Research ... \npatterns rather than on mean temperature and rainfall as in the past. With the aid\n ...", - "htmlSnippet": "a new and growing field in which the Department's \u003cb\u003eWeather\u003c/b\u003e. Radar Research ... \u003cbr\u003e\n\u003cb\u003epatterns\u003c/b\u003e rather than on mean temperature and rainfall as in the past. With the aid\u003cbr\u003e\n ...", - "mime": "application/pdf", - "fileFormat": "PDF/Adobe Acrobat", - "formattedUrl": "https://libraries.mit.edu/archives/mithistory/presidents-reports/1955.pdf", - "htmlFormattedUrl": "https://libraries.mit.edu/archives/mithistory/presidents-reports/1955.pdf", - "pagemap": { - "metatags": [ - { - "creationdate": "D:20071230223610-05'00'", - "moddate": "D:20071230223610-05'00'" - } - ] - } } ] } http_version: - recorded_at: Thu, 01 Sep 2016 15:16:54 GMT + recorded_at: Fri, 02 Sep 2016 14:15:22 GMT recorded_with: VCR 3.0.3 diff --git a/test/vcr_cassettes/google_no_results.yml b/test/vcr_cassettes/google_no_results.yml index 2c8a7ca2..c2b4c03f 100644 --- a/test/vcr_cassettes/google_no_results.yml +++ b/test/vcr_cassettes/google_no_results.yml @@ -2,34 +2,34 @@ http_interactions: - request: method: get - uri: https://www.googleapis.com/customsearch/v1?cx=FAKE_GOOGLE_CUSTOM_SEARCH_ID&key=FAKE_GOOGLE_API_KEY&q=asdffdsaasdffdsa + uri: https://www.googleapis.com/customsearch/v1?cx=FAKE_GOOGLE_CUSTOM_SEARCH_ID&key=FAKE_GOOGLE_API_KEY&num=3&q=asdffdsaasdffdsa body: encoding: UTF-8 string: '' headers: User-Agent: - |- - unknown/0.0.0 google-api-ruby-client/0.9.12 Mac OS X/10.11.6 + unknown/0.0.0 google-api-ruby-client/0.9.13 Mac OS X/10.11.6 (gzip) Accept: - "*/*" Accept-Encoding: - gzip,deflate Date: - - Mon, 29 Aug 2016 19:49:09 GMT + - Fri, 02 Sep 2016 14:15:21 GMT response: status: code: 200 message: OK headers: Expires: - - Mon, 29 Aug 2016 19:49:10 GMT + - Fri, 02 Sep 2016 14:15:22 GMT Date: - - Mon, 29 Aug 2016 19:49:10 GMT + - Fri, 02 Sep 2016 14:15:22 GMT Cache-Control: - private, max-age=0, must-revalidate, no-transform Etag: - - '"ZK6WcJ2_cdL-1Kol5cpaPQsD0mI/koSKWtB-vgP9PvsxNyX8srpe7cg"' + - '"ZK6WcJ2_cdL-1Kol5cpaPQsD0mI/NFJlDpqCAJ6O5jawomZegzy1nZE"' Vary: - Origin - X-Origin @@ -45,8 +45,6 @@ http_interactions: - 1; mode=block Server: - GSE - Alternate-Protocol: - - 443:quic Alt-Svc: - quic=":443"; ma=2592000; v="36,35,34,33,32,31,30" Transfer-Encoding: @@ -66,7 +64,7 @@ http_interactions: "title": "Google Custom Search - asdffdsaasdffdsa", "totalResults": "0", "searchTerms": "asdffdsaasdffdsa", - "count": 10, + "count": 3, "inputEncoding": "utf8", "outputEncoding": "utf8", "safe": "off", @@ -75,12 +73,12 @@ http_interactions: ] }, "searchInformation": { - "searchTime": 0.425516, - "formattedSearchTime": "0.43", + "searchTime": 0.376984, + "formattedSearchTime": "0.38", "totalResults": "0", "formattedTotalResults": "0" } } http_version: - recorded_at: Mon, 29 Aug 2016 19:49:10 GMT + recorded_at: Fri, 02 Sep 2016 14:15:22 GMT recorded_with: VCR 3.0.3 diff --git a/test/vcr_cassettes/invalid_google_credentials.yml b/test/vcr_cassettes/invalid_google_credentials.yml index 5691f120..61987871 100644 --- a/test/vcr_cassettes/invalid_google_credentials.yml +++ b/test/vcr_cassettes/invalid_google_credentials.yml @@ -2,7 +2,7 @@ http_interactions: - request: method: get - uri: https://www.googleapis.com/customsearch/v1?cx=FAKE_GOOGLE_CUSTOM_SEARCH_ID&key=FAKE_GOOGLE_API_KEY&q=endnote + uri: https://www.googleapis.com/customsearch/v1?cx=FAKE_GOOGLE_CUSTOM_SEARCH_ID&key=FAKE_GOOGLE_API_KEY&num=3&q=endnote body: encoding: UTF-8 string: '' @@ -65,6 +65,6 @@ http_interactions: "message": "Bad Request" } } - http_version: + http_version: recorded_at: Mon, 29 Aug 2016 19:01:14 GMT recorded_with: VCR 3.0.3 diff --git a/test/vcr_cassettes/valid_google_search_and_credentials.yml b/test/vcr_cassettes/valid_google_search_and_credentials.yml index 68ddb0f1..414ca015 100644 --- a/test/vcr_cassettes/valid_google_search_and_credentials.yml +++ b/test/vcr_cassettes/valid_google_search_and_credentials.yml @@ -2,34 +2,34 @@ http_interactions: - request: method: get - uri: https://www.googleapis.com/customsearch/v1?cx=FAKE_GOOGLE_CUSTOM_SEARCH_ID&key=FAKE_GOOGLE_API_KEY&q=endnote + uri: https://www.googleapis.com/customsearch/v1?cx=FAKE_GOOGLE_CUSTOM_SEARCH_ID&key=FAKE_GOOGLE_API_KEY&num=3&q=endnote body: encoding: UTF-8 string: '' headers: User-Agent: - |- - unknown/0.0.0 google-api-ruby-client/0.9.12 Mac OS X/10.11.6 + unknown/0.0.0 google-api-ruby-client/0.9.13 Mac OS X/10.11.6 (gzip) Accept: - "*/*" Accept-Encoding: - gzip,deflate Date: - - Mon, 29 Aug 2016 17:25:48 GMT + - Fri, 02 Sep 2016 14:14:16 GMT response: status: code: 200 message: OK headers: Expires: - - Mon, 29 Aug 2016 17:25:49 GMT + - Fri, 02 Sep 2016 14:14:17 GMT Date: - - Mon, 29 Aug 2016 17:25:49 GMT + - Fri, 02 Sep 2016 14:14:17 GMT Cache-Control: - private, max-age=0, must-revalidate, no-transform Etag: - - '"ZK6WcJ2_cdL-1Kol5cpaPQsD0mI/VSselOeIGUNfFmgyMMg-vIaD-Xs"' + - '"ZK6WcJ2_cdL-1Kol5cpaPQsD0mI/WoN9v0CyVz3jteP_UH7R-Tetyrc"' Vary: - Origin - X-Origin @@ -45,10 +45,8 @@ http_interactions: - 1; mode=block Server: - GSE - Alternate-Protocol: - - 443:quic Alt-Svc: - - quic=":443"; ma=2592000; v="35,34,33,32,31,30" + - quic=":443"; ma=2592000; v="36,35,34,33,32,31,30" Transfer-Encoding: - chunked body: @@ -64,9 +62,9 @@ http_interactions: "request": [ { "title": "Google Custom Search - endnote", - "totalResults": "1640", + "totalResults": "1610", "searchTerms": "endnote", - "count": 10, + "count": 3, "startIndex": 1, "inputEncoding": "utf8", "outputEncoding": "utf8", @@ -77,10 +75,10 @@ http_interactions: "nextPage": [ { "title": "Google Custom Search - endnote", - "totalResults": "1640", + "totalResults": "1610", "searchTerms": "endnote", - "count": 10, - "startIndex": 11, + "count": 3, + "startIndex": 4, "inputEncoding": "utf8", "outputEncoding": "utf8", "safe": "off", @@ -92,10 +90,10 @@ http_interactions: "title": "mitlib_test" }, "searchInformation": { - "searchTime": 0.474704, - "formattedSearchTime": "0.47", - "totalResults": "1640", - "formattedTotalResults": "1,640" + "searchTime": 0.391094, + "formattedSearchTime": "0.39", + "totalResults": "1610", + "formattedTotalResults": "1,610" }, "items": [ { @@ -190,194 +188,9 @@ http_interactions: } ] } - }, - { - "kind": "customsearch#result", - "title": "Overview of citation software at MIT: Managing your references", - "htmlTitle": "Overview of citation software at MIT: Managing your references", - "link": "http://libguides.mit.edu/references", - "displayLink": "libguides.mit.edu", - "snippet": "Mar 29, 2016 ... Desktop client software; also has web interface, EndNote Web, through Web of ... \nExport references from compatible databases into EndNote.", - "htmlSnippet": "Mar 29, 2016 \u003cb\u003e...\u003c/b\u003e Desktop client software; also has web interface, \u003cb\u003eEndNote\u003c/b\u003e Web, through Web of ... \u003cbr\u003e\nExport references from compatible databases into \u003cb\u003eEndNote\u003c/b\u003e.", - "formattedUrl": "libguides.mit.edu/references", - "htmlFormattedUrl": "libguides.mit.edu/references", - "pagemap": { - "metatags": [ - { - "viewport": "width=device-width, initial-scale=1.0", - "dc.title": "LibGuides: Overview of citation software at MIT: Managing your references: Overview", - "dc.creator": "Christine Malinowski", - "dc.subject": "Citation Software", - "dc.publishers": "MIT Libraries", - "dc.rights": "Copyright MIT Libraries 2016", - "dc.language": "en", - "dc.identifier": "http://libguides.mit.edu/c.php?g=176001&p=1159377", - "dc.date.created": "Jul 16, 2009", - "dc.date.modified": "Mar 29, 2016", - "og:title": "LibGuides: Overview of citation software at MIT: Managing your references: Overview", - "og:type": "website", - "og:url": "http://libguides.mit.edu/c.php?g=176001&p=1159377", - "twitter:card": "summary_large_image", - "twitter:site": "@springshare" - } - ] - } - }, - { - "kind": "customsearch#result", - "title": "EndNote basics | MIT Libraries News", - "htmlTitle": "\u003cb\u003eEndNote\u003c/b\u003e basics | MIT Libraries News", - "link": "https://libraries.mit.edu/news/endnote-basics-2/19278/", - "displayLink": "libraries.mit.edu", - "snippet": "Jun 19, 2015 ... EndNote is a “personal bibliographic software” package which allows you to \ncreate and manage a database of bibliographic references.", - "htmlSnippet": "Jun 19, 2015 \u003cb\u003e...\u003c/b\u003e \u003cb\u003eEndNote\u003c/b\u003e is a “personal bibliographic software” package which allows you to \u003cbr\u003e\ncreate and manage a database of bibliographic references.", - "cacheId": "n_fO5nXNPcAJ", - "formattedUrl": "https://libraries.mit.edu/news/endnote-basics-2/19278/", - "htmlFormattedUrl": "https://libraries.mit.edu/news/\u003cb\u003eendnote\u003c/b\u003e-basics-2/19278/", - "pagemap": { - "cse_thumbnail": [ - { - "width": "240", - "height": "180", - "src": "https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcQKEh0xhSjohO1G6xVAZZQuP9PJxGkzAPiKcYFTeKj44bpIaRQP1vqw5jw" - } - ], - "metatags": [ - { - "viewport": "width=device-width, initial-scale=1.0" - } - ], - "cse_image": [ - { - "src": "https://libraries.mit.edu/news/files/2015/06/computermouse-300x225.jpg" - } - ] - } - }, - { - "kind": "customsearch#result", - "title": "Thomson Reuters vs. George Mason University (or EndNote vs ...", - "htmlTitle": "Thomson Reuters vs. George Mason University (or \u003cb\u003eEndNote\u003c/b\u003e vs ...", - "link": "http://libraries.mit.edu/news/endnote-zotero/1207/", - "displayLink": "libraries.mit.edu", - "snippet": "George Mason University (or EndNote vs. Zotero): the Business End of Citation \nManagement Software. By MIT Libraries on October 29, 2008 in Scholarly ...", - "htmlSnippet": "George Mason University (or \u003cb\u003eEndNote\u003c/b\u003e vs. Zotero): the Business End of Citation \u003cbr\u003e\nManagement Software. By MIT Libraries on October 29, 2008 in Scholarly ...", - "cacheId": "cuON3GMQQb8J", - "formattedUrl": "libraries.mit.edu/news/endnote-zotero/1207/", - "htmlFormattedUrl": "libraries.mit.edu/news/\u003cb\u003eendnote\u003c/b\u003e-zotero/1207/", - "pagemap": { - "metatags": [ - { - "viewport": "width=device-width, initial-scale=1.0" - } - ] - } - }, - { - "kind": "customsearch#result", - "title": "Join us for EndNote training: Monday, 3/10 | MIT Libraries News", - "htmlTitle": "Join us for \u003cb\u003eEndNote\u003c/b\u003e training: Monday, 3/10 | MIT Libraries News", - "link": "http://libraries.mit.edu/news/monday-310-endnote/1003/", - "displayLink": "libraries.mit.edu", - "snippet": "Feb 22, 2008 ... Donna Kirking, a representative from EndNote, will offer basic-intermediate \ntraining on building a library and using Word with EndNote.", - "htmlSnippet": "Feb 22, 2008 \u003cb\u003e...\u003c/b\u003e Donna Kirking, a representative from \u003cb\u003eEndNote\u003c/b\u003e, will offer basic-intermediate \u003cbr\u003e\ntraining on building a library and using Word with \u003cb\u003eEndNote\u003c/b\u003e.", - "cacheId": "j2GiDxjOiP0J", - "formattedUrl": "libraries.mit.edu/news/monday-310-endnote/1003/", - "htmlFormattedUrl": "libraries.mit.edu/news/monday-310-\u003cb\u003eendnote\u003c/b\u003e/1003/", - "pagemap": { - "metatags": [ - { - "viewport": "width=device-width, initial-scale=1.0" - } - ] - } - }, - { - "kind": "customsearch#result", - "title": "IAPril 2012: EndNote Basics | MIT Libraries News", - "htmlTitle": "IAPril 2012: \u003cb\u003eEndNote\u003c/b\u003e Basics | MIT Libraries News", - "link": "http://libraries.mit.edu/news/iapril-2012-endnote/8182/", - "displayLink": "libraries.mit.edu", - "snippet": "Mar 28, 2012 ... EndNote is a “personal bibliographic software” package which allows you to \ncreate and manage a database of bibliographic references.", - "htmlSnippet": "Mar 28, 2012 \u003cb\u003e...\u003c/b\u003e \u003cb\u003eEndNote\u003c/b\u003e is a “personal bibliographic software” package which allows you to \u003cbr\u003e\ncreate and manage a database of bibliographic references.", - "cacheId": "bh7CxaGKQfIJ", - "formattedUrl": "libraries.mit.edu/news/iapril-2012-endnote/8182/", - "htmlFormattedUrl": "libraries.mit.edu/news/iapril-2012-\u003cb\u003eendnote\u003c/b\u003e/8182/", - "pagemap": { - "metatags": [ - { - "viewport": "width=device-width, initial-scale=1.0" - } - ] - } - }, - { - "kind": "customsearch#result", - "title": "Cite data - Social Science Data Services - LibGuides at MIT Libraries", - "htmlTitle": "Cite data - Social Science Data Services - LibGuides at MIT Libraries", - "link": "http://libguides.mit.edu/ssds/cite", - "displayLink": "libguides.mit.edu", - "snippet": "In Endnote use the reference type for \"dataset.\" If you're using Mendeley or \nZotero, make due with using other more generic reference type templates and fill \nin ...", - "htmlSnippet": "In \u003cb\u003eEndnote\u003c/b\u003e use the reference type for "dataset." If you're using Mendeley or \u003cbr\u003e\nZotero, make due with using other more generic reference type templates and fill \u003cbr\u003e\nin ...", - "formattedUrl": "libguides.mit.edu/ssds/cite", - "htmlFormattedUrl": "libguides.mit.edu/ssds/cite", - "pagemap": { - "cse_thumbnail": [ - { - "width": "80", - "height": "80", - "src": "https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcR7J6rLFQZ2hsYrJiDv9OlkmJXIXOFIWr9vetjTb4q9D3FRxsHxW6IB" - } - ], - "metatags": [ - { - "viewport": "width=device-width, initial-scale=1.0", - "dc.title": "LibGuides: Social Science Data Services: Cite data", - "dc.creator": "Jennie Murack", - "dc.subject": "Management & Business, Social Sciences", - "dc.description": "This is the Social Science Data Services site which provides/pulls together guidance on finding statistics and data in the social sciences.", - "dc.publishers": "MIT Libraries", - "dc.rights": "Copyright MIT Libraries 2016", - "dc.language": "en", - "dc.identifier": "http://libguides.mit.edu/ssds/cite", - "dc.date.created": "Jul 26, 2013", - "dc.date.modified": "Aug 24, 2016", - "og:title": "LibGuides: Social Science Data Services: Cite data", - "og:description": "This is the Social Science Data Services site which provides/pulls together guidance on finding statistics and data in the social sciences.", - "og:type": "website", - "og:url": "http://libguides.mit.edu/ssds/cite", - "twitter:card": "summary_large_image", - "twitter:site": "@springshare" - } - ], - "cse_image": [ - { - "src": "http://s3.amazonaws.com/libapps/accounts/15421/profiles/12065/murack-100x100.jpg" - } - ] - } - }, - { - "kind": "customsearch#result", - "title": "Learn about RefWorks, EndNote, patent searching and more via video", - "htmlTitle": "Learn about RefWorks, \u003cb\u003eEndNote\u003c/b\u003e, patent searching and more via video", - "link": "https://libraries.mit.edu/news/learn-about-refworks/2977/", - "displayLink": "libraries.mit.edu", - "snippet": "Mar 3, 2010 ... manage your citations using RefWorks or EndNote; search for patents; research \nprospective employers; use Google Maps, find research data ...", - "htmlSnippet": "Mar 3, 2010 \u003cb\u003e...\u003c/b\u003e manage your citations using RefWorks or \u003cb\u003eEndNote\u003c/b\u003e; search for patents; research \u003cbr\u003e\nprospective employers; use Google Maps, find research data ...", - "cacheId": "5QF-Ek8uxF8J", - "formattedUrl": "https://libraries.mit.edu/news/learn-about-refworks/2977/", - "htmlFormattedUrl": "https://libraries.mit.edu/news/learn-about-refworks/2977/", - "pagemap": { - "metatags": [ - { - "viewport": "width=device-width, initial-scale=1.0" - } - ] - } } ] } http_version: - recorded_at: Mon, 29 Aug 2016 17:25:49 GMT + recorded_at: Fri, 02 Sep 2016 14:14:17 GMT recorded_with: VCR 3.0.3 diff --git a/test/vcr_cassettes/valid_search_and_credentials.yml b/test/vcr_cassettes/valid_search_and_credentials.yml index 2784988a..d7a4b496 100644 --- a/test/vcr_cassettes/valid_search_and_credentials.yml +++ b/test/vcr_cassettes/valid_search_and_credentials.yml @@ -559,7 +559,7 @@ http_interactions: recorded_at: Thu, 01 Sep 2016 15:47:32 GMT - request: method: get - uri: https://www.googleapis.com/customsearch/v1?cx=FAKE_GOOGLE_CUSTOM_SEARCH_ID&key=FAKE_GOOGLE_API_KEY&q=popcorn + uri: https://www.googleapis.com/customsearch/v1?cx=FAKE_GOOGLE_CUSTOM_SEARCH_ID&key=FAKE_GOOGLE_API_KEY&num=3&q=popcorn body: encoding: UTF-8 string: ''