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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 934bc3f9140e9e7d05752813f4ad4cf73a6c603a
4
- data.tar.gz: 31a9cdb3b1d4fdddbb644e5eb1968d6525793dd7
3
+ metadata.gz: b412ca8857c464f987babf676353da5431d869a6
4
+ data.tar.gz: c404d5ba1aeef989688bddf7a0e8791cb70cf4d9
5
5
  SHA512:
6
- metadata.gz: 49151a16a869d8ce35afe718e5eb3ccf0741eac7fa8a1894ef7fd1f9f3020a74db8781be87aac7ba83dfb5a55e01a498d109d99146e8441e8384a785b38b4396
7
- data.tar.gz: 848fcf36c3e98fe79068790928057428fa5d3914c9b35632b8e65069e992a12605dcbc1daf291e303bca26d67c365f95e8ee1e07f66de1c618dad8a3f92a55c1
6
+ metadata.gz: 0d2bad202b72ce5104963d30bf33e088391efd14b9f7769620f98bf2226eac0b7335b14141075a389158df3324ee89fed0819ba5f222ad6f1087043f03133373
7
+ data.tar.gz: 96c13f8a8d245abddcab9c10f25cf917cb560fa9b06e127d1b3aec5ca3ac81c23e894af1a95ecbc517f66b44468a85bac2895d5c5eb4e6d3d9ba28ab06bf231a
@@ -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
- status_last_update_at: tds[12].text
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'
@@ -1,3 +1,3 @@
1
1
  module EchoLink
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: echo_link
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Elliott