takuhai_status 1.4.1 → 1.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/takuhai_status/japanpost.rb +19 -8
- data/lib/takuhai_status/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca5e2767e709bd9aa9a8991009c77ac7e00afd16
|
4
|
+
data.tar.gz: 210a6a33b154a40ab185df723b607b3b6e138697
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 196e05de9e2fcf5f1af5f3cbf32c3b78f26db4a433f0f0a75b02e69b8d72bfb5a1f9c02696a8f4826836853ed55ce04d5a9df42e222adda1c4aef2bbbd133654
|
7
|
+
data.tar.gz: 13aa79c96495f3186e6da4fa7e43447fe4a94bb6d586342aae6e3d154f88390031d8a336d63d4c06771355c8bc4fc3bc75edbb0fff86638699d7ce8f961f9a8f
|
@@ -20,14 +20,25 @@ module TakuhaiStatus
|
|
20
20
|
doc = Nokogiri(open(uri, &:read))
|
21
21
|
|
22
22
|
begin
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
23
|
+
begin
|
24
|
+
# japanese baggage
|
25
|
+
cols = doc.css('.tableType01')[1].css('tr')
|
26
|
+
col = cols[cols.size - 2]
|
27
|
+
stime = col.css('td')[0].text
|
28
|
+
time = Time.parse(stime)
|
29
|
+
station = " [#{col.css('td')[3].text}]"
|
30
|
+
station = " [#{col.css('td')[4].text.strip}]" if station.size <= 4
|
31
|
+
station = "" if station.size <= 4
|
32
|
+
state = "#{col.css('td')[1].text}#{station}"
|
33
|
+
rescue NoMethodError
|
34
|
+
# international baggage
|
35
|
+
cols = doc.css('.tableType01 tr')
|
36
|
+
col = cols[cols.size - 2]
|
37
|
+
stime = col.css('td')[2].text
|
38
|
+
time = Time.parse(stime)
|
39
|
+
station = " [#{col.css('td')[4].text}/#{col.css('td')[5].text}]"
|
40
|
+
state = "#{col.css('td')[3].text}#{station}"
|
41
|
+
end
|
31
42
|
|
32
43
|
return time, state
|
33
44
|
rescue NoMethodError
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: takuhai_status
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- TADA Tadashi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|