tw_hospital 0.0.1.9 → 0.0.2
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/module/shh.rb +1 -1
- data/lib/module/sltung.rb +1 -1
- data/lib/tw_hospital/version.rb +1 -1
- data/lib/tw_hospital.rb +1 -4
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3fccdce498884b35c9c8486602e442fdbd7347ff
|
|
4
|
+
data.tar.gz: 45ee949473eeb8178b004619608de1e1eab3e52e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9d0ced029f8710485bb83f1cb8ad27fd1c5191ab2480cbeb407c2f7a08b8f56f2956df331629f4d593379411237abdf65cc275dc292068fdfb0ac10e9705084d
|
|
7
|
+
data.tar.gz: f8c69c654eaedc8c127210f171267de624f86a5655c690979961c23d65ed19b0f491f53096494b5a0c939e3902513f93aa095abeafe672d4acc0e1402de42eb2
|
data/lib/module/shh.rb
CHANGED
|
@@ -6,7 +6,7 @@ module Shh
|
|
|
6
6
|
html = open(url).read
|
|
7
7
|
html.encode!("big5")
|
|
8
8
|
page = Nokogiri::HTML.parse html
|
|
9
|
-
hash[:hospital] = "
|
|
9
|
+
hash[:hospital] = "shh"
|
|
10
10
|
hash[:to_119] = page.css("#off").text.strip
|
|
11
11
|
hash[:wait_see] = page.css("#Label1").text.strip
|
|
12
12
|
hash[:wait_push_bed] = page.css("#Label2").text.strip
|
data/lib/module/sltung.rb
CHANGED
|
@@ -11,7 +11,6 @@ module Sltung
|
|
|
11
11
|
page = Nokogiri::HTML(open(url))
|
|
12
12
|
text = page.css("body div.wrapper div span").text
|
|
13
13
|
hash = self.get_situation(text)
|
|
14
|
-
hash[:hospital] = "sltung"
|
|
15
14
|
# hash[:to_119] = page.css("#GridView1 tr:nth-child(2) td:nth-child(2)").text.strip
|
|
16
15
|
# hash[:wait_see] = page.css("#GridView1 tr:nth-child(3) td:nth-child(2)").text.strip
|
|
17
16
|
# hash[:wait_push_bed] = page.css("#GridView1 tr:nth-child(4) td:nth-child(2)").text.strip
|
|
@@ -22,6 +21,7 @@ module Sltung
|
|
|
22
21
|
|
|
23
22
|
def self.get_situation(text)
|
|
24
23
|
hash = {}
|
|
24
|
+
hash[:hospital] = "sltung"
|
|
25
25
|
text.split(":").each_with_index do |each_text, index|
|
|
26
26
|
next if index == 0
|
|
27
27
|
if index == 1
|
data/lib/tw_hospital/version.rb
CHANGED
data/lib/tw_hospital.rb
CHANGED
|
@@ -65,10 +65,7 @@ module TwHospital
|
|
|
65
65
|
json << Edah.crawl
|
|
66
66
|
json << Cgmh_ks.crawl
|
|
67
67
|
json << Tzuchi_hl.crawl
|
|
68
|
-
|
|
69
|
-
File.open("#{filename}.json", "w") do |f|
|
|
70
|
-
f.write(JSON.pretty_generate(json))
|
|
71
|
-
end
|
|
68
|
+
return json
|
|
72
69
|
end
|
|
73
70
|
|
|
74
71
|
def TwHospital.schedule_fetch_all
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: tw_hospital
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- JackHou
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-02-
|
|
11
|
+
date: 2015-02-10 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -134,7 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
134
134
|
version: '0'
|
|
135
135
|
requirements: []
|
|
136
136
|
rubyforge_project:
|
|
137
|
-
rubygems_version: 2.
|
|
137
|
+
rubygems_version: 2.0.14
|
|
138
138
|
signing_key:
|
|
139
139
|
specification_version: 4
|
|
140
140
|
summary: This gem would fetch all tw hospital emergency data.
|