echo_link 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/echo_link/scraper.rb +12 -2
- data/lib/echo_link/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: b412ca8857c464f987babf676353da5431d869a6
|
4
|
+
data.tar.gz: c404d5ba1aeef989688bddf7a0e8791cb70cf4d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d2bad202b72ce5104963d30bf33e088391efd14b9f7769620f98bf2226eac0b7335b14141075a389158df3324ee89fed0819ba5f222ad6f1087043f03133373
|
7
|
+
data.tar.gz: 96c13f8a8d245abddcab9c10f25cf917cb560fa9b06e127d1b3aec5ca3ac81c23e894af1a95ecbc517f66b44468a85bac2895d5c5eb4e6d3d9ba28ab06bf231a
|
data/lib/echo_link/scraper.rb
CHANGED
@@ -42,9 +42,9 @@ module EchoLink
|
|
42
42
|
power: tds[7].text,
|
43
43
|
haat: tds[8].text,
|
44
44
|
antenna: tds[9].text,
|
45
|
-
status: tds[10].text,
|
45
|
+
status: clean_status(tds[10].text),
|
46
46
|
comment: tds[11].text,
|
47
|
-
|
47
|
+
status_updated_at: tds[12].text
|
48
48
|
}
|
49
49
|
end
|
50
50
|
links
|
@@ -52,6 +52,16 @@ module EchoLink
|
|
52
52
|
|
53
53
|
private
|
54
54
|
|
55
|
+
def clean_status(status)
|
56
|
+
case status.downcase
|
57
|
+
when 'off' then 'offline'
|
58
|
+
when 'conn' then 'connected'
|
59
|
+
when 'online' then 'online'
|
60
|
+
else
|
61
|
+
'unknown'
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
55
65
|
def curl(url)
|
56
66
|
http = Curl.get(url) do |http|
|
57
67
|
http.headers['User-Agent'] = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.116 Safari/537.36'
|
data/lib/echo_link/version.rb
CHANGED