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.
- checksums.yaml +4 -4
- data/lib/google_search_results.rb +6 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e75dbb1a41dce3064428df1892c5df64303fc834
|
4
|
+
data.tar.gz: daf75e1ce5b65da69c0e685e887e227f5019dcfe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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.
|
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-
|
11
|
+
date: 2017-12-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|