google_search_results 0.0.2 → 0.1.0
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 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0899a32cef6abed47a9b920b7ec17ebda201ab81'
|
4
|
+
data.tar.gz: 7bd94626b964705d2075c4fe7642c966bbfd68c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 90a1a22f6a293af5374a129d4c2895e58c4eb5c2b04e1589a270d5ab1aac8dcc5253ac33c372e58dea0af70d0a4ce91cdd0a2afbc0204b536b089726f681eceb
|
7
|
+
data.tar.gz: 7783e0c512887a162ed174cc4b846fedfe4d2d97f46ce6e742b3c3069b36377e810e99cd2824cea796b9a5313203ed525f68e3ebe03e0f148ec875e88c9848a2
|
@@ -6,9 +6,11 @@ require_relative 'google_search_results/hash'
|
|
6
6
|
|
7
7
|
class GoogleSearchResults
|
8
8
|
|
9
|
-
VERSION = "0.0
|
9
|
+
VERSION = "0.1.0"
|
10
10
|
BACKEND = "serpapi.com"
|
11
11
|
|
12
|
+
@@serp_api_key = nil
|
13
|
+
|
12
14
|
class << self
|
13
15
|
attr_accessor :serp_api_key
|
14
16
|
end
|
@@ -21,7 +23,9 @@ class GoogleSearchResults
|
|
21
23
|
|
22
24
|
def construct_url
|
23
25
|
@params[:source] = "ruby"
|
24
|
-
|
26
|
+
if @params[:serp_api_key].nil? and GoogleSearchResults.serp_api_key
|
27
|
+
@params[:serp_api_key] = GoogleSearchResults.serp_api_key
|
28
|
+
end
|
25
29
|
URI::HTTPS.build(host: BACKEND, path: '/search', query: URI.encode_www_form(@params))
|
26
30
|
end
|
27
31
|
|