adglare 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/adglare.rb +5 -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: 7312ac495a7a1ba8d41cae88c4c782dc7d1bf4b4
|
4
|
+
data.tar.gz: f484a8710f6f396586107ba3504528b3e06c95ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6150c4a2f962dd956d989d9f1036d302eca19467a21b601b913cc5b088c114ae7e375050eeed979ef3b311a160c2d00a1158a1db761deca7d23b2951ebb8fbd0
|
7
|
+
data.tar.gz: c9d91322b378031aace3d607350a04693f0f3a2a8e8f7789fb920f5a86b03ada7789ea6b66aa948493edb746e2249138547f9f6e81034533c145326fe949d366
|
data/lib/adglare.rb
CHANGED
@@ -2,7 +2,8 @@ class Adglare
|
|
2
2
|
require 'digest/sha1'
|
3
3
|
require 'curb'
|
4
4
|
require 'json'
|
5
|
-
|
5
|
+
require 'byebug'
|
6
|
+
|
6
7
|
attr_accessor :public_key, :private_key, :ajax
|
7
8
|
# If ajax is true, the class will output the required Javascript to make the API call, instead of using CURL
|
8
9
|
|
@@ -173,9 +174,11 @@ class Adglare
|
|
173
174
|
# parse response into JSON object
|
174
175
|
json = JSON.parse content
|
175
176
|
|
176
|
-
if json["response"]["success"] == '1'
|
177
|
+
if json["response"]["success"] == '1' || json["response"]["errormsg"] == "No results with these filters."
|
177
178
|
if json["response"]["data"]
|
178
179
|
return json["response"]["data"]
|
180
|
+
elsif json["response"]["errormsg"] == "No results with these filters."
|
181
|
+
return []
|
179
182
|
else
|
180
183
|
return json["response"]
|
181
184
|
end
|