galerts 1.0.5 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/galerts/defaults.rb +1 -0
- data/lib/galerts/manager.rb +4 -0
- data/lib/galerts/version.rb +1 -1
- 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: a115cb20e419155562ad8d1c81de77d64e143a84
|
4
|
+
data.tar.gz: 35109efa123cf9433bc8fcf2f1760a553c9099d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6dc87543aea78b84ddf00e030986058e69baadfef80a2590993f1c5c1255f80051396dc20aa61a17e720ad9da9d2b4e8d3a4c22ef4e8c98f23444c2b860a8095
|
7
|
+
data.tar.gz: 67e9794c8ab97fdd9824e5a0f972091602895f0bec055c0fd7958d439e4f0d4917a35eee748efcb04c78bff305aeab141d9c28eabb45ac9010174c6159c8f890
|
data/lib/galerts/defaults.rb
CHANGED
@@ -19,6 +19,7 @@ module Galerts
|
|
19
19
|
ALERT_EXIST = "[null,11,null,\"\"]"
|
20
20
|
ALERT_SOMETHING_WENT_WRONG = "[null,7,null,\"\"]"
|
21
21
|
ALERT_NOT_EXIST = "[null,5,null,\"\"]"
|
22
|
+
ALERT_LIMIT_EXCEEDED = "[null,4,null,\"\"]"
|
22
23
|
# Google Value
|
23
24
|
BEST_RESULTS = 'Only the best results'
|
24
25
|
ALL_RESULTS = 'All results'
|
data/lib/galerts/manager.rb
CHANGED
@@ -15,6 +15,8 @@ module Galerts
|
|
15
15
|
@agent.keep_alive = true
|
16
16
|
@agent.redirect_ok = true
|
17
17
|
@agent.follow_meta_refresh = true
|
18
|
+
@agent.open_timeout=10
|
19
|
+
@agent.read_timeout=10
|
18
20
|
end
|
19
21
|
|
20
22
|
def login
|
@@ -133,6 +135,8 @@ module Galerts
|
|
133
135
|
find_by_query(query).first
|
134
136
|
elsif response.body == ALERT_SOMETHING_WENT_WRONG
|
135
137
|
raise "Something went wrong!" # internal error, html changed maybe
|
138
|
+
elsif response.body == ALERT_LIMIT_EXCEEDED
|
139
|
+
raise "You have exceeded the limit of 1000 alerts per account"
|
136
140
|
else
|
137
141
|
response_body = response.body.gsub('null', 'nil')
|
138
142
|
created_alert = Nokogiri::HTML(eval(response_body)[4][0][2], nil, 'utf-8')
|
data/lib/galerts/version.rb
CHANGED