lita-cwb 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/lita/handlers/cwb.rb +6 -3
- data/lita-cwb.gemspec +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: f650ffbfe5aa9304c779a982d4c3e2c420f0cc5a
|
4
|
+
data.tar.gz: fee0a8e5e6af0a1fe992ca1765d51f939631372f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1cff7a01ba7cb61ab80127c411fb6162985bdb3d52f7e2aaa53291f05e70cc21183738c9c95bee7478fe3b439e5b1a7aa749ab687ace1bac0cf002ab11a739c8
|
7
|
+
data.tar.gz: 29cdbd3725a07259116f07f56ba81f1c95c0da2a2225b93651ad98cfb5422af16589074936c4701f091fce3e6435adec040e0255fd59a551797c3c7218333071
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# lita-cwb
|
2
2
|
|
3
|
-
|
3
|
+
*lita-cwb* is a Lita handler with Open Data from Central Weather Bureau (中央氣象局)
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -16,4 +16,4 @@ TODO: Describe any configuration attributes the plugin exposes.
|
|
16
16
|
|
17
17
|
## Usage
|
18
18
|
|
19
|
-
|
19
|
+
* lita> `cwb f [WHERE]` - Show me forecast information for location WHERE (e.g: '台北市')
|
data/lib/lita/handlers/cwb.rb
CHANGED
@@ -61,10 +61,13 @@ module Lita
|
|
61
61
|
return
|
62
62
|
end
|
63
63
|
|
64
|
-
data = Nokogiri::XML(open(uri))
|
64
|
+
data = Nokogiri::XML(open(uri)) do |config|
|
65
|
+
config.strict.noblanks
|
66
|
+
end
|
67
|
+
|
65
68
|
response.reply data.css("dataset location locationName").text
|
66
|
-
data.css("dataset parameterSet parameter").each do |
|
67
|
-
response.reply
|
69
|
+
data.css("dataset parameterSet parameter").each do |param|
|
70
|
+
response.reply param.css("parameterValue").text
|
68
71
|
end
|
69
72
|
end
|
70
73
|
end
|
data/lita-cwb.gemspec
CHANGED