lita-onewheel-odot-tripcheck-web-hack 0.0.5 → 0.1.0

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: 985b7671fade98b897a592452ec5f38ff7bc0a54
4
- data.tar.gz: 9197cd2686b802ec539fe9a885b44a9570fb7b93
3
+ metadata.gz: f2a1e573ef6bee8af4cefd2469266ca1a6cf01bb
4
+ data.tar.gz: 36679c5941657ff451711d88430907a81dc3f290
5
5
  SHA512:
6
- metadata.gz: 0e951399d1d5fcbdb8b58a2aa6a073a4b2dc5abde53dc1fdd0fa30b0bb0083d2cc5b5db2c2bee441b317d26210a1311345d4c372db3653de7eacac9389f40e6b
7
- data.tar.gz: c45e8bdf96eae5ebeeeeb1691fb6b0ae422ce720120776423cb636ea59aec699daa4ed4c60cc1deb90d5cfef58270b6749a598e66e82eaf5d8be883612e9948d
6
+ metadata.gz: 72db08debf89f064ad3d827e33e4092889eacec44bddeb53e469a0c8c2ff84e62858b528a412fb4ff3c4e2b269968d1483acdfa166c0f448fe750605bdc86e0d
7
+ data.tar.gz: '009f3c9ae6f85581b0eeda9ca55de8b458352660b22f26450474ad3f87f970bffe56e025634f09ccd426461f07144ca8a8445a9a186173c9a902c213070c0978'
@@ -9,16 +9,19 @@ module Lita
9
9
  help: { 'tripcheck': 'Display a list of tripcheck cameras covered.'})
10
10
 
11
11
  def get_cameras
12
+ uri_base = 'https://tripcheck.com/RoadCams/cams/'
13
+
12
14
  {
13
15
  # 'Hood River': %w(Hood%20River%20Exit%2064a_pid1863.JPG Hood%20River%20Exit%2063_pid1860.JPG),
14
- 'Hood River': 'Hood%20River%20Exit%2064a_pid1863.JPG',
15
- '26 at 35': 'US26%20at%20Hwy35_pid1881.JPG',
16
- '26 at Snow Bunny': 'US26%20at%20Snow%20Bunny_pid1887.JPG',
16
+ 'Hood River': uri_base + 'Hood%20River%20Exit%2064a_pid1863.JPG',
17
+ '26 at 35': uri_base + 'US26%20at%20Hwy35_pid1881.JPG',
18
+ '26 at Snow Bunny': uri_base + 'US26%20at%20Snow%20Bunny_pid1887.JPG',
17
19
  # '26 at Govy': %w(GovernmentCamp_pid624.jpg US26%20at%20Govn%20Camp%20Maint_pid1899.JPG),
18
- '26 at Govy': 'US26%20at%20Govn%20Camp%20Maint_pid1899.JPG',
19
- '26 at Govy Loop Rd': 'US26%20at%20Govt%20Camp%20Lp%20Rd_pid1776.JPG',
20
- '26 at Frog Lake': 'US26%20at%20Frog%20Lake%20VMS_pid1773.JPG',
21
- '26 at Blue Box Pass': 'Blue%20Box%20Pass_pid1919.JPG'
20
+ '26 at Govy': uri_base + 'US26%20at%20Govn%20Camp%20Maint_pid1899.JPG',
21
+ '26 at Govy Loop Rd': uri_base + 'US26%20at%20Govt%20Camp%20Lp%20Rd_pid1776.JPG',
22
+ '26 at Frog Lake': uri_base + 'US26%20at%20Frog%20Lake%20VMS_pid1773.JPG',
23
+ '26 at Blue Box Pass': uri_base + 'Blue%20Box%20Pass_pid1919.JPG',
24
+ 'Sandy Blvd in Hollywood': 'https://launchpad.pin13.net/cam/sandy'
22
25
  }
23
26
  end
24
27
 
@@ -26,12 +29,10 @@ module Lita
26
29
  input = response.matches[0][0]
27
30
  Lita.logger.debug "Looking for '#{input}'"
28
31
 
29
- uri_base = 'https://tripcheck.com/RoadCams/cams/'
30
-
31
32
  get_cameras.keys.each do |camera_key|
32
33
  Lita.logger.debug "Trying to match '#{input.downcase}' to '#{camera_key.downcase}'"
33
34
  if camera_key.to_s.downcase.include? input.downcase
34
- response.reply "#{uri_base}#{get_cameras[camera_key]}?rand=#{Time.now.to_i}123"
35
+ response.reply "#{get_cameras[camera_key]}?rand=#{Time.now.to_i}123"
35
36
  return # Quick exit.
36
37
  end
37
38
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'lita-onewheel-odot-tripcheck-web-hack'
3
- spec.version = '0.0.5'
3
+ spec.version = '0.1.0'
4
4
  spec.authors = ['Andrew Kreps']
5
5
  spec.email = ['andrew.kreps@gmail.com']
6
6
  spec.description = %q{ODOT Tripcheck Cameras}
@@ -14,6 +14,6 @@ describe Lita::Handlers::OnewheelOdotTripcheckWebHack, lita_handler: true do
14
14
 
15
15
  it 'will list tripchecks' do
16
16
  send_command 'tripcheck'
17
- expect(replies.last).to eq('Cameras available include: Hood River, 26 at 35, 26 at Snow Bunny, 26 at Govy, 26 at Govy Loop Rd, 26 at Frog Lake, 26 at Blue Box Pass')
17
+ expect(replies.last).to eq('Cameras available include: Hood River, 26 at 35, 26 at Snow Bunny, 26 at Govy, 26 at Govy Loop Rd, 26 at Frog Lake, 26 at Blue Box Pass, Sandy Blvd in Hollywood')
18
18
  end
19
19
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-onewheel-odot-tripcheck-web-hack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kreps
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-05 00:00:00.000000000 Z
11
+ date: 2016-12-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lita