google_search_results 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google_search_results.rb +6 -1
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4be11b8f4cd10f3ceebf0c3cba8f9f71cbaa5e64
4
- data.tar.gz: bdcc25442a55c75c51902b55f48e1f72a56fe104
3
+ metadata.gz: e75dbb1a41dce3064428df1892c5df64303fc834
4
+ data.tar.gz: daf75e1ce5b65da69c0e685e887e227f5019dcfe
5
5
  SHA512:
6
- metadata.gz: 0be283b7a34891c4575331dc811609abf3a4386cf5b139ef41b497a2ea200ea9f85a6c39ef6e6ab1cb856bb85b7dc337751b212de20f903e4edea3b3e885333f
7
- data.tar.gz: 7bd32b47260fb9ba7c86ce3252fa4dd88b92ddcb822e7161a90ce830520cff8a0942ac8722c6b5a6c0edfe199ddd45dd32d8cea8038dbde4f6dc5ca9ad737e59
6
+ metadata.gz: 40536a6fde13196006e48fcd4540122302e68e1d147373bfc56f8b0a07b81930506e2d8b8825b8567dcc4572c3627743301230e538da1b3310a2b6cb5e798215
7
+ data.tar.gz: 0d717386a0483ac1da341401c108451db5b65f28c4b773eb82efe1908a00fbbbb57895b002ddc0d3fe062b90c4cb282b51de254cf67b7cf682247c0c72f87002
@@ -6,9 +6,13 @@ require_relative 'google_search_results/hash'
6
6
 
7
7
  class GoogleSearchResults
8
8
 
9
- VERSION = "0.0.1"
9
+ VERSION = "0.0.2"
10
10
  BACKEND = "serpapi.com"
11
11
 
12
+ class << self
13
+ attr_accessor :serp_api_key
14
+ end
15
+
12
16
  attr_accessor :params
13
17
 
14
18
  def initialize params
@@ -17,6 +21,7 @@ class GoogleSearchResults
17
21
 
18
22
  def construct_url
19
23
  @params[:source] = "ruby"
24
+ @params[:serp_api_key] = (@params[:serp_api_key] ? @params[:serp_api_key] : @@serp_api_key)
20
25
  URI::HTTPS.build(host: BACKEND, path: '/search', query: URI.encode_www_form(@params))
21
26
  end
22
27
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google_search_results
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - hartator
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-21 00:00:00.000000000 Z
11
+ date: 2017-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake