lita-onewheel-wolfram-alpha 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a5d688876e161a072f799d99f5ba09899dfcc26f
|
4
|
+
data.tar.gz: 9a57ed46329c2ed8b6f39d9f92078b3c8eaa0ad5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0417397dc6623098bf37e7eb518d33aa369f8a3ff1841f756bacf2059ccdba00b6c77fde8b329b5f0ce8cfd768925d7d85a08b1258017210ae2f709186d1a1cd
|
7
|
+
data.tar.gz: 6ca95a0a67c67ef316abc49ea52904bf11da155902068733fb501871e8d6f8950ca0693f1e3c397d30285deaac48cc1a0a7cec4ba15e498b690c09c34288865e
|
@@ -11,12 +11,13 @@ module Lita
|
|
11
11
|
|
12
12
|
def handle_wolfram_query(response)
|
13
13
|
unless config.app_id and config.api_uri
|
14
|
-
Lita.logger.error 'Configuration error!'
|
14
|
+
Lita.logger.error 'lita-onewheel-wolfram-alpha: Configuration error!'
|
15
15
|
return
|
16
16
|
end
|
17
17
|
query = response.matches[0][0]
|
18
18
|
api_response = make_api_call query
|
19
19
|
reply = parse_response api_response, query
|
20
|
+
Lita.logger.debug "lita-onewheel-wolfram-alpha: Replying with #{reply}"
|
20
21
|
response.reply reply
|
21
22
|
end
|
22
23
|
|
@@ -33,7 +34,7 @@ module Lita
|
|
33
34
|
end
|
34
35
|
|
35
36
|
else
|
36
|
-
"Wolfram couldn't parse #{query}."
|
37
|
+
"lita-onewheel-wolfram-alpha: Wolfram couldn't parse #{query}."
|
37
38
|
end
|
38
39
|
end
|
39
40
|
|
@@ -42,7 +43,7 @@ module Lita
|
|
42
43
|
end
|
43
44
|
|
44
45
|
def make_api_call(query)
|
45
|
-
Lita.logger.debug "Making api call for #{query}"
|
46
|
+
Lita.logger.debug "lita-onewheel-wolfram-alpha: Making api call for #{query}"
|
46
47
|
uri = build_uri query
|
47
48
|
response = RestClient.get(uri)
|
48
49
|
Nokogiri::XML response.to_s
|
@@ -50,7 +51,7 @@ module Lita
|
|
50
51
|
|
51
52
|
def build_uri(query)
|
52
53
|
uri = config.api_uri.sub '[query]', CGI::escape(query)
|
53
|
-
uri
|
54
|
+
uri.sub '[appid]', config.app_id
|
54
55
|
end
|
55
56
|
end
|
56
57
|
Lita.register_handler(OnewheelWolframAlpha)
|