tw_hospital 0.0.2 → 0.0.3
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/.gitignore +1 -0
- data/lib/module/cch.rb +14 -9
- data/lib/module/cgh.rb +12 -7
- data/lib/module/cgmh_chayi.rb +14 -8
- data/lib/module/cgmh_kl.rb +13 -8
- data/lib/module/cgmh_ks.rb +13 -8
- data/lib/module/cgmh_lingko.rb +13 -8
- data/lib/module/chimei.rb +16 -11
- data/lib/module/chimei_cl.rb +16 -11
- data/lib/module/chimei_ly.rb +16 -11
- data/lib/module/cmuh.rb +12 -7
- data/lib/module/csh.rb +19 -14
- data/lib/module/edah.rb +14 -9
- data/lib/module/kmuh.rb +12 -7
- data/lib/module/ktgh_dajia.rb +14 -9
- data/lib/module/ktgh_shalu.rb +14 -9
- data/lib/module/mmh.rb +12 -7
- data/lib/module/ncku.rb +14 -9
- data/lib/module/ndmctsgh.rb +14 -9
- data/lib/module/ntuh_taipei.rb +14 -9
- data/lib/module/ntuh_yunlin.rb +14 -9
- data/lib/module/pohai.rb +12 -7
- data/lib/module/scmh.rb +14 -9
- data/lib/module/shh.rb +14 -9
- data/lib/module/skh.rb +13 -8
- data/lib/module/sltung.rb +8 -8
- data/lib/module/tzuchi.rb +12 -7
- data/lib/module/tzuchi_hl.rb +12 -7
- data/lib/module/vghtc.rb +14 -9
- data/lib/module/vghtpe.rb +12 -7
- data/lib/module/wanfang.rb +13 -8
- data/lib/tw_hospital.rb +2 -2
- data/lib/tw_hospital/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: 3f6fa92c1a28c8b687b44ca06bb107d1cac6695b
|
4
|
+
data.tar.gz: aa04707b7b7c72ac87f45c6a035ea9256fb32f74
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9cb93360b24b17f496b7ad2184b66213b9267b2c1560bb776372fcea4cee040625d4a6a785d387950673deaf03b425917d7587bba32f66a74375be139db2bf53
|
7
|
+
data.tar.gz: 27c78736d800d309c8db8802ac51e78bcfeb14fb7bfd50449979752f8204d7f500e81f07799494df4126340ce82abca4276d892aee11b90163911ad429ceb55b
|
data/.gitignore
CHANGED
data/lib/module/cch.rb
CHANGED
@@ -1,15 +1,20 @@
|
|
1
1
|
# 彰化基督教醫療財團法人彰化基督教醫院
|
2
2
|
module Cch
|
3
3
|
def Cch.crawl
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
4
|
+
begin
|
5
|
+
hash = {}
|
6
|
+
url = "http://www.cch.org.tw/news/er_news.aspx"
|
7
|
+
page = Nokogiri::HTML(open(url))
|
8
|
+
hash[:hospital] = "cch"
|
9
|
+
hash[:to_119] = page.css("#Image2").map {|i| i['alt']}[0]
|
10
|
+
hash[:wait_see] = page.css("#Txt_Label2").text.strip
|
11
|
+
hash[:wait_push_bed] = page.css("#Txt_Label3").text.strip
|
12
|
+
hash[:wait_bed] = page.css("#Txt_Label4").text.strip
|
13
|
+
hash[:wait_cure_bed] = page.css("#Txt_Label5").text.strip
|
14
|
+
rescue Exception => e
|
15
|
+
p e.message
|
16
|
+
return nil
|
17
|
+
end
|
13
18
|
return hash
|
14
19
|
end
|
15
20
|
end
|
data/lib/module/cgh.rb
CHANGED
@@ -3,13 +3,18 @@ module Cgh
|
|
3
3
|
def Cgh.crawl
|
4
4
|
hash = {}
|
5
5
|
url = "http://med.cgh.org.tw/unit/branch/Pharmacy/ebl/RealTimeInfoHQ.html"
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
6
|
+
begin
|
7
|
+
page = Nokogiri::HTML(open(url))
|
8
|
+
hash[:hospital] = "cgh"
|
9
|
+
hash[:to_119] = page.css("center table tr:nth-child(1) td:nth-child(3)").text.strip
|
10
|
+
hash[:wait_see] = page.css("center table tr:nth-child(2) td:nth-child(3)").text.strip
|
11
|
+
hash[:wait_push_bed] = page.css("center table tr:nth-child(3) td:nth-child(3)").text.strip
|
12
|
+
hash[:wait_bed] = page.css("center table tr:nth-child(4) td:nth-child(3)").text.strip
|
13
|
+
hash[:wait_cure_bed] = page.css("center table tr:nth-child(5) td:nth-child(3)").text.strip
|
14
|
+
rescue Exception => e
|
15
|
+
p e.message
|
16
|
+
return nil
|
17
|
+
end
|
13
18
|
return hash
|
14
19
|
end
|
15
20
|
end
|
data/lib/module/cgmh_chayi.rb
CHANGED
@@ -3,13 +3,19 @@ module Cgmh_chayi
|
|
3
3
|
def Cgmh_chayi.crawl
|
4
4
|
hash = {}
|
5
5
|
url = "https://www.cgmh.org.tw/bed/erd/index.asp?loc=6"
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
6
|
+
begin
|
7
|
+
page = Nokogiri::HTML(open(url))
|
8
|
+
hash[:hospital] = "cgmh_chayi"
|
9
|
+
hash[:to_119] = page.css("table:nth-child(1) tr:nth-child(5) td table tr:nth-child(3) td:nth-child(2) font").text.strip
|
10
|
+
hash[:wait_see] = page.css("table:nth-child(1) tr:nth-child(5) td table tr:nth-child(4) td:nth-child(2) font").text.strip
|
11
|
+
hash[:wait_push_bed] = page.css("table:nth-child(1) tr:nth-child(5) td table tr:nth-child(5) td:nth-child(2) font").text.strip
|
12
|
+
hash[:wait_bed] = page.css("table:nth-child(1) tr:nth-child(5) td table tr:nth-child(6) td:nth-child(2) font").text.strip
|
13
|
+
hash[:wait_cure_bed] = page.css("table:nth-child(1) tr:nth-child(5) td table tr:nth-child(7) td:nth-child(2) font").text.strip
|
14
|
+
hash
|
15
|
+
rescue Exception => e
|
16
|
+
p e.message
|
17
|
+
return nil
|
18
|
+
end
|
19
|
+
return hash
|
14
20
|
end
|
15
21
|
end
|
data/lib/module/cgmh_kl.rb
CHANGED
@@ -3,14 +3,19 @@ module Cgmh_kl
|
|
3
3
|
def Cgmh_kl.crawl
|
4
4
|
hash = {}
|
5
5
|
url = "https://www.cgmh.org.tw/bed/erd/index.asp?loc=2"
|
6
|
-
|
6
|
+
begin
|
7
|
+
page = Nokogiri::HTML(open(url))
|
7
8
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
9
|
+
hash[:hospital] = "cgmh_kl"
|
10
|
+
hash[:to_119] = page.css("table:nth-child(1) tr:nth-child(5) td table tr:nth-child(3) td:nth-child(2) font").text.strip
|
11
|
+
hash[:wait_see] = page.css("table:nth-child(1) tr:nth-child(5) td table tr:nth-child(4) td:nth-child(2) font").text.strip
|
12
|
+
hash[:wait_push_bed] = page.css("table:nth-child(1) tr:nth-child(5) td table tr:nth-child(5) td:nth-child(2) font").text.strip
|
13
|
+
hash[:wait_bed] = page.css("table:nth-child(1) tr:nth-child(5) td table tr:nth-child(6) td:nth-child(2) font").text.strip
|
14
|
+
hash[:wait_cure_bed] = page.css("table:nth-child(1) tr:nth-child(5) td table tr:nth-child(7) td:nth-child(2) font").text.strip
|
15
|
+
rescue Exception => e
|
16
|
+
p e.message
|
17
|
+
return nil
|
18
|
+
end
|
19
|
+
return hash
|
15
20
|
end
|
16
21
|
end
|
data/lib/module/cgmh_ks.rb
CHANGED
@@ -3,13 +3,18 @@ module Cgmh_ks
|
|
3
3
|
def Cgmh_ks.crawl
|
4
4
|
hash = {}
|
5
5
|
url = "https://www.cgmh.org.tw/bed/erd/index.asp?loc=8"
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
6
|
+
begin
|
7
|
+
page = Nokogiri::HTML(open(url))
|
8
|
+
hash[:hospital] = "cgmh_ks"
|
9
|
+
hash[:to_119] = page.css("table:nth-child(1) tr:nth-child(5) td table tr:nth-child(3) td:nth-child(2) font").text.strip
|
10
|
+
hash[:wait_see] = page.css("table:nth-child(1) tr:nth-child(5) td table tr:nth-child(4) td:nth-child(2) font").text.strip
|
11
|
+
hash[:wait_push_bed] = page.css("table:nth-child(1) tr:nth-child(5) td table tr:nth-child(5) td:nth-child(2) font").text.strip
|
12
|
+
hash[:wait_bed] = page.css("table:nth-child(1) tr:nth-child(5) td table tr:nth-child(6) td:nth-child(2) font").text.strip
|
13
|
+
hash[:wait_cure_bed] = page.css("table:nth-child(1) tr:nth-child(5) td table tr:nth-child(7) td:nth-child(2) font").text.strip
|
14
|
+
rescue Exception => e
|
15
|
+
p e.message
|
16
|
+
return nil
|
17
|
+
end
|
18
|
+
return hash
|
14
19
|
end
|
15
20
|
end
|
data/lib/module/cgmh_lingko.rb
CHANGED
@@ -3,14 +3,19 @@ module Cgmh_lingko
|
|
3
3
|
def Cgmh_lingko.crawl
|
4
4
|
hash = {}
|
5
5
|
url = "https://www.cgmh.org.tw/bed/erd/index.asp?loc=3"
|
6
|
-
|
6
|
+
begin
|
7
|
+
page = Nokogiri::HTML(open(url))
|
7
8
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
9
|
+
hash[:hospital] = "cgmh_lingko"
|
10
|
+
hash[:to_119] = page.css("table:nth-child(1) tr:nth-child(5) td table tr:nth-child(3) td:nth-child(2) font").text.strip
|
11
|
+
hash[:wait_see] = page.css("table:nth-child(1) tr:nth-child(5) td table tr:nth-child(4) td:nth-child(2) font").text.strip
|
12
|
+
hash[:wait_push_bed] = page.css("table:nth-child(1) tr:nth-child(5) td table tr:nth-child(5) td:nth-child(2) font").text.strip
|
13
|
+
hash[:wait_bed] = page.css("table:nth-child(1) tr:nth-child(5) td table tr:nth-child(6) td:nth-child(2) font").text.strip
|
14
|
+
hash[:wait_cure_bed] = page.css("table:nth-child(1) tr:nth-child(5) td table tr:nth-child(7) td:nth-child(2) font").text.strip
|
15
|
+
rescue Exception => e
|
16
|
+
p e.message
|
17
|
+
return nil
|
18
|
+
end
|
19
|
+
return hash
|
15
20
|
end
|
16
21
|
end
|
data/lib/module/chimei.rb
CHANGED
@@ -3,17 +3,22 @@ module Chimei
|
|
3
3
|
def Chimei.crawl
|
4
4
|
hash = {}
|
5
5
|
url = "http://www.chimei.org.tw/%E6%80%A5%E8%A8%BA%E5%8D%B3%E6%99%82%E8%A8%8A%E6%81%AF/main.aspx?ihosp=10"
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
6
|
+
begin
|
7
|
+
html = open(url).read
|
8
|
+
html.encode!("big5")
|
9
|
+
page = Nokogiri::HTML.parse html
|
10
|
+
hash[:hospital] = "chimei"
|
11
|
+
hash[:to_119] = page.css("#form1 div:nth-child(2) table tr:nth-child(4) td div:nth-child(3) table tr:nth-child(2) td:nth-child(1)").text.strip
|
12
|
+
hash[:wait_see] = page.css("#form1 div:nth-child(2) table tr:nth-child(4) td div:nth-child(3) table tr:nth-child(2) td:nth-child(2)").text.strip
|
13
|
+
hash[:emergency_number] = page.css("#form1 div:nth-child(2) table tr:nth-child(4) td div:nth-child(3) table tr:nth-child(2) td:nth-child(3)").text.strip
|
14
|
+
hash[:wait_paediatrics] = page.css("#form1 div:nth-child(2) table tr:nth-child(4) td div:nth-child(3) table tr:nth-child(2) td:nth-child(4)").text.strip
|
15
|
+
hash[:wait_bed] = page.css("#form1 div:nth-child(2) table tr:nth-child(4) td div:nth-child(3) table tr:nth-child(2) td:nth-child(5)").text.strip
|
16
|
+
hash[:wait_cure_bed] = page.css("#form1 div:nth-child(2) table tr:nth-child(4) td div:nth-child(3) table tr:nth-child(2) td:nth-child(6)").text.strip
|
17
|
+
hash[:wait_push_bed] = page.css("#form1 div:nth-child(2) table tr:nth-child(4) td div:nth-child(3) table tr:nth-child(2) td:nth-child(7)").text.strip
|
18
|
+
rescue Exception => e
|
19
|
+
p e.message
|
20
|
+
return nil
|
21
|
+
end
|
17
22
|
return hash
|
18
23
|
end
|
19
24
|
end
|
data/lib/module/chimei_cl.rb
CHANGED
@@ -3,17 +3,22 @@ module Chimei_cl
|
|
3
3
|
def Chimei_cl.crawl
|
4
4
|
hash = {}
|
5
5
|
url = "http://www.chimei.org.tw/%E6%80%A5%E8%A8%BA%E5%8D%B3%E6%99%82%E8%A8%8A%E6%81%AF/main.aspx?ihosp=10"
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
6
|
+
begin
|
7
|
+
html = open(url).read
|
8
|
+
html.encode!("big5")
|
9
|
+
page = Nokogiri::HTML.parse html
|
10
|
+
hash[:hospital] = "chimei_cl"
|
11
|
+
hash[:to_119] = page.css("#form1 div:nth-child(2) table tr:nth-child(4) td div:nth-child(13) table tr:nth-child(2) td:nth-child(1)").text.strip
|
12
|
+
hash[:wait_see] = page.css("#form1 div:nth-child(2) table tr:nth-child(4) td div:nth-child(13) table tr:nth-child(2) td:nth-child(2)").text.strip
|
13
|
+
hash[:emergency_number] = page.css("#form1 div:nth-child(2) table tr:nth-child(4) td div:nth-child(13) table tr:nth-child(2) td:nth-child(3)").text.strip
|
14
|
+
hash[:wait_paediatrics] = page.css("#form1 div:nth-child(2) table tr:nth-child(4) td div:nth-child(13) table tr:nth-child(2) td:nth-child(4)").text.strip
|
15
|
+
hash[:wait_bed] = page.css("#form1 div:nth-child(2) table tr:nth-child(4) td div:nth-child(13) table tr:nth-child(2) td:nth-child(5)").text.strip
|
16
|
+
hash[:wait_cure_bed] = page.css("#form1 div:nth-child(2) table tr:nth-child(4) td div:nth-child(13) table tr:nth-child(2) td:nth-child(6)").text.strip
|
17
|
+
hash[:wait_push_bed] = page.css("#form1 div:nth-child(2) table tr:nth-child(4) td div:nth-child(13) table tr:nth-child(2) td:nth-child(7)").text.strip
|
18
|
+
rescue Exception => e
|
19
|
+
p e.message
|
20
|
+
return nil
|
21
|
+
end
|
17
22
|
return hash
|
18
23
|
end
|
19
24
|
end
|
data/lib/module/chimei_ly.rb
CHANGED
@@ -3,17 +3,22 @@ module Chimei_ly
|
|
3
3
|
def Chimei_ly.crawl
|
4
4
|
hash = {}
|
5
5
|
url = "http://www.chimei.org.tw/%E6%80%A5%E8%A8%BA%E5%8D%B3%E6%99%82%E8%A8%8A%E6%81%AF/main.aspx?ihosp=10"
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
6
|
+
begin
|
7
|
+
html = open(url).read
|
8
|
+
html.encode!("big5")
|
9
|
+
page = Nokogiri::HTML.parse html
|
10
|
+
hash[:hospital] = "chimei_ly"
|
11
|
+
hash[:to_119] = page.css("#form1 div:nth-child(2) table tr:nth-child(4) td div:nth-child(8) table tr:nth-child(2) td:nth-child(1)").text.strip
|
12
|
+
hash[:wait_see] = page.css("#form1 div:nth-child(2) table tr:nth-child(4) td div:nth-child(8) table tr:nth-child(2) td:nth-child(2)").text.strip
|
13
|
+
hash[:emergency_number] = page.css("#form1 div:nth-child(2) table tr:nth-child(4) td div:nth-child(8) table tr:nth-child(2) td:nth-child(3)").text.strip
|
14
|
+
hash[:wait_paediatrics] = page.css("#form1 div:nth-child(2) table tr:nth-child(4) td div:nth-child(8) table tr:nth-child(2) td:nth-child(4)").text.strip
|
15
|
+
hash[:wait_bed] = page.css("#form1 div:nth-child(2) table tr:nth-child(4) td div:nth-child(8) table tr:nth-child(2) td:nth-child(5)").text.strip
|
16
|
+
hash[:wait_cure_bed] = page.css("#form1 div:nth-child(2) table tr:nth-child(4) td div:nth-child(8) table tr:nth-child(2) td:nth-child(6)").text.strip
|
17
|
+
hash[:wait_push_bed] = page.css("#form1 div:nth-child(2) table tr:nth-child(4) td div:nth-child(8) table tr:nth-child(2) td:nth-child(7)").text.strip
|
18
|
+
rescue Exception => e
|
19
|
+
p e.message
|
20
|
+
return nil
|
21
|
+
end
|
17
22
|
return hash
|
18
23
|
end
|
19
24
|
end
|
data/lib/module/cmuh.rb
CHANGED
@@ -4,13 +4,18 @@ module Cmuh
|
|
4
4
|
def Cmuh.crawl
|
5
5
|
hash = {}
|
6
6
|
url = "http://61.66.117.8/EmrCount/Default.aspx"
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
7
|
+
begin
|
8
|
+
page = Nokogiri::HTML(open(url))
|
9
|
+
hash[:hospital] = "cmuh"
|
10
|
+
hash[:to_119] = page.css("#GridView1 tr:nth-child(2) td:nth-child(2)").text.strip
|
11
|
+
hash[:wait_see] = page.css("#GridView1 tr:nth-child(3) td:nth-child(2)").text.strip
|
12
|
+
hash[:wait_push_bed] = page.css("#GridView1 tr:nth-child(4) td:nth-child(2)").text.strip
|
13
|
+
hash[:wait_bed] = page.css("#GridView1 tr:nth-child(5) td:nth-child(2)").text.strip
|
14
|
+
hash[:wait_cure_bed] = page.css("#GridView1 tr:nth-child(6) td:nth-child(2)").text.strip
|
15
|
+
rescue Exception => e
|
16
|
+
p e.message
|
17
|
+
return nil
|
18
|
+
end
|
14
19
|
return hash
|
15
20
|
end
|
16
21
|
end
|
data/lib/module/csh.rb
CHANGED
@@ -3,20 +3,25 @@ module Csh
|
|
3
3
|
def Csh.crawl
|
4
4
|
hash = {}
|
5
5
|
url = "http://www.csh.org.tw/ER/index.aspx"
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
6
|
+
begin
|
7
|
+
html = open(url).read
|
8
|
+
html.encode!("big5")
|
9
|
+
page = Nokogiri::HTML.parse html
|
10
|
+
hash[:hospital] = "csh"
|
11
|
+
hash[:wait_see] = page.css("#WaitVisitCount").text.strip
|
12
|
+
hash[:wait_push_bed] = page.css("#WaitErBedCount").text.strip
|
13
|
+
hash[:wait_bed] = page.css("#WaitInpBedCount").text.strip
|
14
|
+
hash[:wait_cure_bed] = page.css("#WaitInpBedCount").text.strip
|
15
|
+
hash[:wait_internal_medicine] = page.css("#WaitBedInME").text.strip
|
16
|
+
hash[:wait_surgery] = page.css("#WaitBedInSE").text.strip
|
17
|
+
hash[:wait_paediatrics] = page.css("#WaitBedInPE").text.strip
|
18
|
+
hash[:wait_gynaecology] = page.css("#WaitBedInGE").text.strip
|
19
|
+
hash[:wait_other] = page.css("#WaitBedOthers").text.strip
|
20
|
+
hash[:to_119] = page.css("#ReportStatus").text.strip
|
21
|
+
rescue Exception => e
|
22
|
+
p e.message
|
23
|
+
return nil
|
24
|
+
end
|
20
25
|
return hash
|
21
26
|
end
|
22
27
|
end
|
data/lib/module/edah.rb
CHANGED
@@ -3,15 +3,20 @@ module Edah
|
|
3
3
|
def Edah.crawl
|
4
4
|
hash = {}
|
5
5
|
url = "http://www3.edah.org.tw/E-DA/WebRegister/ProcessEmeInf.jsp"
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
6
|
+
begin
|
7
|
+
html = open(url).read
|
8
|
+
html.encode!("big5")
|
9
|
+
page = Nokogiri::HTML.parse html
|
10
|
+
hash[:hospital] = "edah"
|
11
|
+
hash[:to_119] = self.split(page.css("body table tr:nth-child(1) td font").text.strip)
|
12
|
+
hash[:wait_see] = self.split(page.css("body table tr:nth-child(2) td font").text.strip)
|
13
|
+
hash[:wait_push_bed] = self.split(page.css("body table tr:nth-child(3) td font").text.strip)
|
14
|
+
hash[:wait_bed] = self.split(page.css("body table tr:nth-child(4) td font").text.strip)
|
15
|
+
hash[:wait_cure_bed] = self.split(page.css("body table tr:nth-child(5) td font").text.strip)
|
16
|
+
rescue Exception => e
|
17
|
+
p e.message
|
18
|
+
return nil
|
19
|
+
end
|
15
20
|
return hash
|
16
21
|
end
|
17
22
|
|
data/lib/module/kmuh.rb
CHANGED
@@ -3,13 +3,18 @@ module Kmuh
|
|
3
3
|
def Kmuh.crawl
|
4
4
|
hash = {}
|
5
5
|
url = "http://www.kmuh.org.tw/KMUHWeb/Pages/P04MedService/ERStatus.aspx"
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
6
|
+
begin
|
7
|
+
page = Nokogiri::HTML(open(url))
|
8
|
+
hash[:hospital] = "kmuh"
|
9
|
+
hash[:to_119] = page.css("#Label_A01").text.strip
|
10
|
+
hash[:wait_see] = page.css("#Label_A02").text.strip
|
11
|
+
hash[:wait_push_bed] = page.css("#Label_A03").text.strip
|
12
|
+
hash[:wait_bed] = page.css("#Label_A04").text.strip
|
13
|
+
hash[:wait_cure_bed] = page.css("#Label_A05").text.strip
|
14
|
+
rescue Exception => e
|
15
|
+
p e.message
|
16
|
+
return nil
|
17
|
+
end
|
13
18
|
return hash
|
14
19
|
end
|
15
20
|
end
|
data/lib/module/ktgh_dajia.rb
CHANGED
@@ -3,15 +3,20 @@ module Ktgh_dajia
|
|
3
3
|
def Ktgh_dajia.crawl
|
4
4
|
hash = {}
|
5
5
|
url = "http://www.ktgh.com.tw/BednoInfo_Show.asp?CatID=81&ModuleType=Y"
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
6
|
+
begin
|
7
|
+
html = open(url).read
|
8
|
+
html.encode!("big5")
|
9
|
+
page = Nokogiri::HTML.parse html
|
10
|
+
hash[:hospital] = "ktgh_dajia"
|
11
|
+
# hash[:to_119] = page.css("#off").text.strip
|
12
|
+
hash[:wait_see] = page.css("#Table3 > tr:nth-child(2) > td > table:nth-child(2) tr:nth-child(2) td:nth-child(2)").text.strip
|
13
|
+
hash[:wait_push_bed] = page.css("#Table3 > tr:nth-child(2) > td > table:nth-child(2) tr:nth-child(2) td:nth-child(3)").text.strip
|
14
|
+
hash[:wait_bed] = page.css("#Table3 > tr:nth-child(2) > td > table:nth-child(2) tr:nth-child(2) td:nth-child(4)").text.strip
|
15
|
+
hash[:wait_cure_bed] = page.css("#Table3 > tr:nth-child(2) > td > table:nth-child(2) tr:nth-child(2) td:nth-child(5)").text.strip
|
16
|
+
rescue Exception => e
|
17
|
+
p e.message
|
18
|
+
return nil
|
19
|
+
end
|
15
20
|
return hash
|
16
21
|
end
|
17
22
|
end
|
data/lib/module/ktgh_shalu.rb
CHANGED
@@ -3,15 +3,20 @@ module Ktgh_shalu
|
|
3
3
|
def Ktgh_shalu.crawl
|
4
4
|
hash = {}
|
5
5
|
url = "http://www.ktgh.com.tw/BednoInfo_Show.asp?CatID=80&ModuleType=Y"
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
6
|
+
begin
|
7
|
+
html = open(url).read
|
8
|
+
html.encode!("big5")
|
9
|
+
page = Nokogiri::HTML.parse html
|
10
|
+
hash[:hospital] = "ktgh_shalu"
|
11
|
+
# hash[:to_119] = page.css("#off").text.strip
|
12
|
+
hash[:wait_see] = page.css("#Table3 > tr:nth-child(2) > td > table:nth-child(2) tr:nth-child(2) td:nth-child(2)").text.strip
|
13
|
+
hash[:wait_push_bed] = page.css("#Table3 > tr:nth-child(2) > td > table:nth-child(2) tr:nth-child(2) td:nth-child(3)").text.strip
|
14
|
+
hash[:wait_bed] = page.css("#Table3 > tr:nth-child(2) > td > table:nth-child(2) tr:nth-child(2) td:nth-child(4)").text.strip
|
15
|
+
hash[:wait_cure_bed] = page.css("#Table3 > tr:nth-child(2) > td > table:nth-child(2) tr:nth-child(2) td:nth-child(5)").text.strip
|
16
|
+
rescue Exception => e
|
17
|
+
p e.message
|
18
|
+
return nil
|
19
|
+
end
|
15
20
|
return hash
|
16
21
|
end
|
17
22
|
end
|
data/lib/module/mmh.rb
CHANGED
@@ -3,13 +3,18 @@ module Mmh
|
|
3
3
|
def Mmh.crawl
|
4
4
|
hash = {}
|
5
5
|
url = "http://www.pohai.org.tw/pohai/bedqty_er/bedqty_er.php"
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
6
|
+
begin
|
7
|
+
page = Nokogiri::HTML(open(url))
|
8
|
+
hash[:hospital] = "mmh"
|
9
|
+
hash[:to_119] = page.css("table tr:nth-child(2) td table tr:nth-child(2) td:nth-child(1)").text.strip
|
10
|
+
hash[:wait_see] = page.css("table tr:nth-child(2) td table tr:nth-child(2) td:nth-child(2)").text.gsub("人", "").strip
|
11
|
+
hash[:wait_push_bed] = page.css("table tr:nth-child(2) td table tr:nth-child(2) td:nth-child(3)").text.gsub("人", "").strip
|
12
|
+
hash[:wait_bed] = page.css("table tr:nth-child(2) td table tr:nth-child(2) td:nth-child(4)").text.gsub("人", "").strip
|
13
|
+
hash[:wait_cure_bed] = page.css("table tr:nth-child(2) td table tr:nth-child(2) td:nth-child(5)").text.gsub("人", "").strip
|
14
|
+
rescue Exception => e
|
15
|
+
p e.message
|
16
|
+
return nil
|
17
|
+
end
|
13
18
|
return hash
|
14
19
|
end
|
15
20
|
end
|
data/lib/module/ncku.rb
CHANGED
@@ -3,15 +3,20 @@ module Ncku
|
|
3
3
|
def Ncku.crawl
|
4
4
|
hash = {}
|
5
5
|
url = "http://www.hosp.ncku.edu.tw/nckm/ER/default.aspx"
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
6
|
+
begin
|
7
|
+
html = open(url).read
|
8
|
+
html.encode!("big5")
|
9
|
+
page = Nokogiri::HTML.parse html
|
10
|
+
hash[:hospital] = "ncku"
|
11
|
+
hash[:to_119] = page.css("#lbBulletin").text.strip
|
12
|
+
hash[:wait_see] = page.css("#lbSee").text.strip
|
13
|
+
hash[:wait_push_bed] = page.css("#lbBed").text.strip
|
14
|
+
hash[:wait_bed] = page.css("#lbIn").text.strip
|
15
|
+
hash[:wait_cure_bed] = page.css("#lbICU").text.strip
|
16
|
+
rescue Exception => e
|
17
|
+
p e.message
|
18
|
+
return nil
|
19
|
+
end
|
15
20
|
return hash
|
16
21
|
end
|
17
22
|
end
|
data/lib/module/ndmctsgh.rb
CHANGED
@@ -2,15 +2,20 @@ module Ndmctsgh
|
|
2
2
|
def Ndmctsgh.crawl
|
3
3
|
hash = {}
|
4
4
|
url = "http://www1.ndmctsgh.edu.tw/ErOnlineNews/ErOnLineData.aspx"
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
5
|
+
begin
|
6
|
+
html = open(url).read
|
7
|
+
html.encode!("big5")
|
8
|
+
page = Nokogiri::HTML.parse html
|
9
|
+
hash[:hospital] = "ndmctsgh"
|
10
|
+
hash[:to_119] = page.css("#Label7").text.strip
|
11
|
+
hash[:wait_see] = page.css("#Label8").text.strip
|
12
|
+
hash[:wait_push_bed] = page.css("#Label9").text.strip
|
13
|
+
hash[:wait_bed] = page.css("#Label10").text.strip
|
14
|
+
hash[:wait_cure_bed] = page.css("#Label11").text.strip
|
15
|
+
rescue Exception => e
|
16
|
+
p e.message
|
17
|
+
return nil
|
18
|
+
end
|
14
19
|
return hash
|
15
20
|
end
|
16
21
|
end
|
data/lib/module/ntuh_taipei.rb
CHANGED
@@ -3,15 +3,20 @@ module Ntuh_taipei
|
|
3
3
|
def Ntuh_taipei.crawl
|
4
4
|
hash = {}
|
5
5
|
url = "https://reg.ntuh.gov.tw/EmgInfoBoard/NTUHEmgInfo.aspx"
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
6
|
+
begin
|
7
|
+
html = open(url).read
|
8
|
+
html.encode!("big5")
|
9
|
+
page = Nokogiri::HTML.parse html
|
10
|
+
hash[:hospital] = "ntuh_taipei"
|
11
|
+
hash[:wait_register] = page.css("#form1 table tr:nth-child(1) td:nth-child(2)").text.gsub("人", "").strip
|
12
|
+
hash[:wait_see] = page.css("#form1 table tr:nth-child(2) td:nth-child(2)").text.gsub("人", "").strip
|
13
|
+
hash[:wait_bed] = page.css("#form1 table tr:nth-child(3) td:nth-child(2)").text.gsub("人", "").strip
|
14
|
+
hash[:wait_icu ] = page.css("#form1 table tr:nth-child(4) td:nth-child(2)").text.gsub("人", "").strip
|
15
|
+
hash[:wait_push_bed] = page.css("#form1 table tr:nth-child(5) td:nth-child(2)").text.gsub("人", "").strip
|
16
|
+
rescue Exception => e
|
17
|
+
p e.message
|
18
|
+
return nil
|
19
|
+
end
|
15
20
|
return hash
|
16
21
|
end
|
17
22
|
end
|
data/lib/module/ntuh_yunlin.rb
CHANGED
@@ -2,15 +2,20 @@ module Ntuh_yunlin
|
|
2
2
|
def Ntuh_yunlin.crawl
|
3
3
|
hash = {}
|
4
4
|
url = "http://reg.ntuh.gov.tw/EmgInfoBoard/Y0NTUHEmgInfo.aspx"
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
5
|
+
begin
|
6
|
+
html = open(url).read
|
7
|
+
html.encode!("big5")
|
8
|
+
page = Nokogiri::HTML.parse html
|
9
|
+
hash[:hospital] = "ntuh_yunlin"
|
10
|
+
hash[:wait_register] = page.css("#form1 table tr:nth-child(1) td:nth-child(2)").text.gsub("人", "").strip
|
11
|
+
hash[:wait_see] = page.css("#form1 table tr:nth-child(2) td:nth-child(2)").text.gsub("人", "").strip
|
12
|
+
hash[:wait_bed] = page.css("#form1 table tr:nth-child(3) td:nth-child(2)").text.gsub("人", "").strip
|
13
|
+
hash[:wait_icu ] = page.css("#form1 table tr:nth-child(4) td:nth-child(2)").text.gsub("人", "").strip
|
14
|
+
hash[:wait_push_bed] = page.css("#form1 table tr:nth-child(5) td:nth-child(2)").text.gsub("人", "").strip
|
15
|
+
rescue Exception => e
|
16
|
+
p e.message
|
17
|
+
return nil
|
18
|
+
end
|
14
19
|
return hash
|
15
20
|
end
|
16
21
|
end
|
data/lib/module/pohai.rb
CHANGED
@@ -3,13 +3,18 @@ module Pohai
|
|
3
3
|
def Pohai.crawl
|
4
4
|
hash = {}
|
5
5
|
url = "http://www.pohai.org.tw/pohai/bedqty_er/bedqty_er.php"
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
6
|
+
begin
|
7
|
+
page = Nokogiri::HTML(open(url))
|
8
|
+
hash[:hospital] = "pohai"
|
9
|
+
hash[:to_119] = page.css("table tr:nth-child(2) td table tr:nth-child(2) td:nth-child(1)").text.strip
|
10
|
+
hash[:wait_see] = page.css("table tr:nth-child(2) td table tr:nth-child(2) td:nth-child(2)").text.gsub("人", "").strip
|
11
|
+
hash[:wait_push_bed] = page.css("table tr:nth-child(2) td table tr:nth-child(2) td:nth-child(3)").text.gsub("人", "").strip
|
12
|
+
hash[:wait_bed] = page.css("table tr:nth-child(2) td table tr:nth-child(2) td:nth-child(4)").text.gsub("人", "").strip
|
13
|
+
hash[:wait_cure_bed] = page.css("table tr:nth-child(2) td table tr:nth-child(2) td:nth-child(5)").text.gsub("人", "").strip
|
14
|
+
rescue Exception => e
|
15
|
+
p e.message
|
16
|
+
return nil
|
17
|
+
end
|
13
18
|
return hash
|
14
19
|
end
|
15
20
|
end
|
data/lib/module/scmh.rb
CHANGED
@@ -3,15 +3,20 @@ module Scmh
|
|
3
3
|
def Scmh.crawl
|
4
4
|
hash = {}
|
5
5
|
url = "http://www.scmh.org.tw/"
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
6
|
+
begin
|
7
|
+
html = open(url).read
|
8
|
+
html.encode!("big5")
|
9
|
+
page = Nokogiri::HTML.parse html
|
10
|
+
hash[:hospital] = "scmh"
|
11
|
+
# hash[:to_119] = page.css("").text.strip
|
12
|
+
hash[:wait_see] = page.css("#aspnetForm table tr:nth-child(6) td table tr td.map table tr td:nth-child(1) table:nth-child(2) tr td div.TVtext table tr:nth-child(1) td:nth-child(2)").text.strip
|
13
|
+
hash[:wait_push_bed] = page.css("#ctl00_ContentPlaceHolder1_ERTVView_min_LabelBN").text.strip
|
14
|
+
hash[:wait_bed] = page.css("#ctl00_ContentPlaceHolder1_ERTVView_min_LabelHN").text.strip
|
15
|
+
hash[:wait_cure_bed] = page.css("#ctl00_ContentPlaceHolder1_ERTVView_min_LabelICN").text.strip
|
16
|
+
rescue Exception => e
|
17
|
+
p e.message
|
18
|
+
return nil
|
19
|
+
end
|
15
20
|
return hash
|
16
21
|
end
|
17
22
|
end
|
data/lib/module/shh.rb
CHANGED
@@ -3,15 +3,20 @@ module Shh
|
|
3
3
|
def Shh.crawl
|
4
4
|
hash = {}
|
5
5
|
url = "http://eng.shh.org.tw/ER_WEB/ER_WEB/"
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
6
|
+
begin
|
7
|
+
html = open(url).read
|
8
|
+
html.encode!("big5")
|
9
|
+
page = Nokogiri::HTML.parse html
|
10
|
+
hash[:hospital] = "shh"
|
11
|
+
hash[:to_119] = page.css("#off").text.strip
|
12
|
+
hash[:wait_see] = page.css("#Label1").text.strip
|
13
|
+
hash[:wait_push_bed] = page.css("#Label2").text.strip
|
14
|
+
hash[:wait_bed] = page.css("#Label3").text.strip
|
15
|
+
hash[:wait_cure_bed] = page.css("#Label4").text.strip
|
16
|
+
rescue Exception => e
|
17
|
+
p e.message
|
18
|
+
return nil
|
19
|
+
end
|
15
20
|
return hash
|
16
21
|
end
|
17
22
|
end
|
data/lib/module/skh.rb
CHANGED
@@ -3,14 +3,19 @@ module Skh
|
|
3
3
|
def Skh.crawl
|
4
4
|
hash = {}
|
5
5
|
url = "https://regis.skh.org.tw/ERONLINE/INDEX.aspx"
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
6
|
+
begin
|
7
|
+
page = Nokogiri::HTML(open(url))
|
8
|
+
hash[:hospital] = "skh"
|
9
|
+
hash[:wait_internal_medicine] = page.css("#L_TOT2").text.strip
|
10
|
+
hash[:wait_surgery] = page.css("#L_TOT1").text.strip
|
11
|
+
hash[:wait_paediatrics] = page.css("#L_TOT3").text.strip
|
12
|
+
hash[:wait_push_bed] = page.css("#L_TOT7").text.strip
|
13
|
+
hash[:wait_bed] = page.css("#L_TOT5").text.strip
|
14
|
+
hash[:wait_icu] = page.css("#L_TOT6").text.strip
|
15
|
+
rescue Exception => e
|
16
|
+
p e.message
|
17
|
+
return nil
|
18
|
+
end
|
14
19
|
return hash
|
15
20
|
end
|
16
21
|
end
|
data/lib/module/sltung.rb
CHANGED
@@ -8,14 +8,14 @@ end
|
|
8
8
|
module Sltung
|
9
9
|
def Sltung.crawl
|
10
10
|
url = "http://www.sltung.com.tw/tw/BED/bed.html"
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
11
|
+
begin
|
12
|
+
page = Nokogiri::HTML(open(url))
|
13
|
+
text = page.css("body div.wrapper div span").text
|
14
|
+
hash = self.get_situation(text)
|
15
|
+
rescue Exception => e
|
16
|
+
p e.message
|
17
|
+
return nil
|
18
|
+
end
|
19
19
|
return hash
|
20
20
|
end
|
21
21
|
|
data/lib/module/tzuchi.rb
CHANGED
@@ -3,13 +3,18 @@ module Tzuchi
|
|
3
3
|
def Tzuchi.crawl
|
4
4
|
hash = {}
|
5
5
|
url = "http://www.pohai.org.tw/pohai/bedqty_er/bedqty_er.php"
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
6
|
+
begin
|
7
|
+
page = Nokogiri::HTML(open(url))
|
8
|
+
hash[:hospital] = "tzuchi"
|
9
|
+
hash[:to_119] = page.css("table tr:nth-child(2) td table tr:nth-child(2) td:nth-child(1)").text.strip
|
10
|
+
hash[:wait_see] = page.css("table tr:nth-child(2) td table tr:nth-child(2) td:nth-child(2)").text.gsub("人", "").strip
|
11
|
+
hash[:wait_push_bed] = page.css("table tr:nth-child(2) td table tr:nth-child(2) td:nth-child(3)").text.gsub("人", "").strip
|
12
|
+
hash[:wait_bed] = page.css("table tr:nth-child(2) td table tr:nth-child(2) td:nth-child(4)").text.gsub("人", "").strip
|
13
|
+
hash[:wait_cure_bed] = page.css("table tr:nth-child(2) td table tr:nth-child(2) td:nth-child(5)").text.gsub("人", "").strip
|
14
|
+
rescue Exception => e
|
15
|
+
p e.message
|
16
|
+
return nil
|
17
|
+
end
|
13
18
|
return hash
|
14
19
|
end
|
15
20
|
end
|
data/lib/module/tzuchi_hl.rb
CHANGED
@@ -4,13 +4,18 @@ module Tzuchi_hl
|
|
4
4
|
def Tzuchi_hl.crawl
|
5
5
|
hash = {}
|
6
6
|
url = "http://hlm.tzuchi.com.tw/html/hlinfos.html"
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
7
|
+
begin
|
8
|
+
page = Nokogiri::HTML(open(url))
|
9
|
+
hash[:hospital] = "tzuchi_hl"
|
10
|
+
hash[:to_119] = page.css("body > table tr:nth-child(5) td:nth-child(2)").text.strip
|
11
|
+
hash[:wait_see] = page.css("body > table tr:nth-child(6) td:nth-child(2)").text.strip
|
12
|
+
hash[:wait_push_bed] = page.css("body > table tr:nth-child(7) td:nth-child(2)").text.strip
|
13
|
+
hash[:wait_bed] = page.css("body > table tr:nth-child(8) td:nth-child(2)").text.strip
|
14
|
+
hash[:wait_cure_bed] = page.css("body > table tr:nth-child(9) td:nth-child(2)").text.strip
|
15
|
+
rescue Exception => e
|
16
|
+
p e.message
|
17
|
+
return nil
|
18
|
+
end
|
14
19
|
return hash
|
15
20
|
end
|
16
21
|
end
|
data/lib/module/vghtc.rb
CHANGED
@@ -3,15 +3,20 @@ module Vghtc
|
|
3
3
|
def Vghtc.crawl
|
4
4
|
hash = {}
|
5
5
|
url = "http://www.vghtc.gov.tw/GipOpenWeb/wSite/sp?xdUrl=/wSite/query/Doctor/GetEmgBedInform.jsp&ctNode=55658&mp=1&idPath=213_55658"
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
6
|
+
begin
|
7
|
+
page = Nokogiri::HTML(open(url))
|
8
|
+
hash[:hospital] = "vghtc"
|
9
|
+
hash[:to_119] = page.css("div.cp table tr:nth-child(2) td:nth-child(2) font b").text.strip
|
10
|
+
hash[:wait_internal_medicine] = page.css("div.cp table tr:nth-child(4) td:nth-child(2) font b").text.gsub("人", "").strip
|
11
|
+
hash[:wait_surgery] = page.css("div.cp table tr:nth-child(5) td:nth-child(2) font b").text.gsub("人", "").strip
|
12
|
+
hash[:wait_paediatrics] = page.css("div.cp table tr:nth-child(6) td:nth-child(2) font b").text.gsub("人", "").strip
|
13
|
+
hash[:wait_push_bed] = page.css("div.cp table tr:nth-child(8) td:nth-child(2) font b").text.gsub("人", "").strip
|
14
|
+
hash[:wait_bed] = page.css("div.cp table tr:nth-child(10) td:nth-child(2) font b").text.gsub("人", "").strip
|
15
|
+
hash[:wait_cure_bed] = page.css("div.cp table tr:nth-child(12) td:nth-child(2) font b").text.gsub("人", "").strip
|
16
|
+
rescue Exception => e
|
17
|
+
p e.message
|
18
|
+
return nil
|
19
|
+
end
|
15
20
|
return hash
|
16
21
|
end
|
17
22
|
end
|
data/lib/module/vghtpe.rb
CHANGED
@@ -3,13 +3,18 @@ module Vghtpe
|
|
3
3
|
def Vghtpe.crawl
|
4
4
|
hash = {}
|
5
5
|
url = "https://www6.vghtpe.gov.tw/ERREALIFO/ERREALIFO.jsp"
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
6
|
+
begin
|
7
|
+
page = Nokogiri::HTML(open(url))
|
8
|
+
hash[:hospital] = "vghtpe"
|
9
|
+
hash[:to_119] = page.css("body table:nth-child(3) tr:nth-child(1) td:nth-child(2) font").text.strip
|
10
|
+
hash[:wait_see] = page.css("body table:nth-child(3) tr:nth-child(2) td:nth-child(2) font").text.strip
|
11
|
+
hash[:wait_push_bed] = page.css("body table:nth-child(3) tr:nth-child(3) td:nth-child(2) font").text.strip
|
12
|
+
hash[:wait_bed] = page.css("body table:nth-child(3) tr:nth-child(4) td:nth-child(2) font").text.strip
|
13
|
+
hash[:wait_cure_bed] = page.css("body table:nth-child(3) tr:nth-child(5) td:nth-child(2) font").text.strip
|
14
|
+
rescue Exception => e
|
15
|
+
p e.message
|
16
|
+
return nil
|
17
|
+
end
|
13
18
|
return hash
|
14
19
|
end
|
15
20
|
end
|
data/lib/module/wanfang.rb
CHANGED
@@ -2,14 +2,19 @@ module Wanfang
|
|
2
2
|
def Wanfang.crawl
|
3
3
|
hash = {}
|
4
4
|
url = "http://www.wanfang.gov.tw/W402008web_new/epd_query.asp"
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
5
|
+
begin
|
6
|
+
page = Nokogiri::HTML(open(url))
|
7
|
+
hash[:hospital] = "wanfang"
|
8
|
+
hash[:to_119] = page.css("body table:nth-child(1) tr:nth-child(9) td:nth-child(1) table tr td ul:nth-child(3) li:nth-child(1)").text.strip
|
9
|
+
hash[:wait_see] = page.css("body table:nth-child(1) tr:nth-child(9) td:nth-child(1) table tr td ul:nth-child(3) li:nth-child(2)").text.gsub("人", "").strip
|
10
|
+
hash[:wait_push_bed] = page.css("body table:nth-child(1) tr:nth-child(9) td:nth-child(1) table tr td ul:nth-child(3) li:nth-child(3)").text.gsub("人", "").strip
|
11
|
+
hash[:wait_bed] = page.css("body table:nth-child(1) tr:nth-child(9) td:nth-child(1) table tr td ul:nth-child(3) li:nth-child(4)").text.gsub("人", "").strip
|
12
|
+
hash[:wait_cure_bed] = page.css("body table:nth-child(1) tr:nth-child(9) td:nth-child(1) table tr td ul:nth-child(3) li:nth-child(5)").text.gsub("人", "").strip
|
13
|
+
hash = self.split(hash)
|
14
|
+
rescue Exception => e
|
15
|
+
p e.message
|
16
|
+
return nil
|
17
|
+
end
|
13
18
|
return hash
|
14
19
|
end
|
15
20
|
|
data/lib/tw_hospital.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require "tw_hospital/version"
|
1
|
+
# require "tw_hospital/version"
|
2
2
|
require 'nokogiri'
|
3
3
|
require 'open-uri'
|
4
4
|
require 'json'
|
@@ -35,7 +35,7 @@ require 'module/cgmh_ks'
|
|
35
35
|
require 'module/tzuchi_hl'
|
36
36
|
|
37
37
|
module TwHospital
|
38
|
-
def TwHospital.fetch_all
|
38
|
+
def TwHospital.fetch_all
|
39
39
|
json = []
|
40
40
|
json << Pohai.crawl
|
41
41
|
json << Cgmh_kl.crawl
|
data/lib/tw_hospital/version.rb
CHANGED