yandex_cleanweb 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/yandex_cleanweb.rb +3 -3
- data/lib/yandex_cleanweb/version.rb +1 -1
- metadata +1 -1
data/lib/yandex_cleanweb.rb
CHANGED
@@ -6,16 +6,16 @@ require "net/http"
|
|
6
6
|
|
7
7
|
module YandexCleanweb
|
8
8
|
API_URL = 'http://cleanweb-api.yandex.ru/1.0/'
|
9
|
-
mattr_accessor :api_key
|
10
9
|
|
11
10
|
class << self
|
11
|
+
attr_accessor :api_key
|
12
|
+
|
12
13
|
def spam?(*options)
|
13
14
|
response = api_check_spam(options)
|
14
|
-
puts response
|
15
15
|
doc = Nokogiri::XML(response)
|
16
|
+
|
16
17
|
request_id_tag = doc.xpath('//check-spam-result/id')
|
17
18
|
spam_flag_tag = doc.xpath('//check-spam-result/text')
|
18
|
-
puts spam_flag_tag.inspect
|
19
19
|
|
20
20
|
request_id = request_id_tag[0]
|
21
21
|
spam_flag = spam_flag_tag[0].attributes["spam-flag"].content
|