mybustracker 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: e485184e0c61f0acea90948b5a905cfac6985f00
4
+ data.tar.gz: '06593b9b4fa21e9d7d2f1f5c49b71aa413f6168f'
5
+ SHA512:
6
+ metadata.gz: 3d4f85c5063bc643bd1c27c8f7b0f8a1af0fcd8a3fe2699ae334a6b9cb2ca67af17505d3a95600b6205066a73924cc6eae13242d3ebdf9358c487fd8ef9c783b
7
+ data.tar.gz: 2092051f1aa751d9b945e70512ae248e81a1787ad7b5f400be5c207987558e0848c2616d5653e957f773e53119886851b1037009a6024917ee7feb1e5b66fef7
checksums.yaml.gz.sig ADDED
Binary file
data.tar.gz.sig ADDED
Binary file
@@ -0,0 +1,46 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # file: mybustracker.rb
4
+
5
+ require 'savon'
6
+ require 'digest'
7
+
8
+ class MyBusTrackerException < Exception
9
+ end
10
+
11
+ class MyBusTracker
12
+
13
+
14
+ def initialize(api_key: '')
15
+
16
+
17
+ raise MyBusTrackerException, 'api_key missing' if api_key.empty?
18
+
19
+ @client = Savon.client(wsdl: 'http://ws.mybustracker.co.uk/?wsdl')
20
+
21
+ #@client.operations
22
+
23
+ #=> [:get_topo_id, :get_services, :get_service_points, :get_dests,
24
+ # :get_bus_stops, :get_bus_times, :get_journey_times, :get_disruptions,
25
+ # :get_diversions, :get_diversion_points]
26
+
27
+ @appkey = Digest::MD5.hexdigest( api_key + Time.now.strftime("%Y%m%d%H"))
28
+
29
+
30
+ end
31
+
32
+ def services()
33
+
34
+ # call the get_services operation
35
+ response = @client.call(:get_services, message: { key: @appkey })
36
+ r = response.body
37
+
38
+ a = r[:services_response][:services][:list].map do |x|
39
+ [x[:mnemo], x[:name]]
40
+ end
41
+
42
+ a.to_h
43
+
44
+ end
45
+ end
46
+
metadata ADDED
@@ -0,0 +1,88 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: mybustracker
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - James Robertson
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain:
11
+ - |
12
+ -----BEGIN CERTIFICATE-----
13
+ MIIDljCCAn6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBIMRIwEAYDVQQDDAlnZW1t
14
+ YXN0ZXIxHjAcBgoJkiaJk/IsZAEZFg5qYW1lc3JvYmVydHNvbjESMBAGCgmSJomT
15
+ 8ixkARkWAmV1MB4XDTE3MDgyNDEwMTgwM1oXDTE4MDgyNDEwMTgwM1owSDESMBAG
16
+ A1UEAwwJZ2VtbWFzdGVyMR4wHAYKCZImiZPyLGQBGRYOamFtZXNyb2JlcnRzb24x
17
+ EjAQBgoJkiaJk/IsZAEZFgJldTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
18
+ ggEBAMsPywY7lLJakQyVlMCUp181qzBLjctEDEMhEF/8dXGnpQpMzBurh4VrrF46
19
+ aN4NgPYlN08ewZ5wKeXtaMNiNcvEI2DqM9SjEjy/fZ48uvrDFFpC5qYfYs/hZnLQ
20
+ aYkA92FdRLYrQ5NURn1nRcb1emheRYX1zE9VFVkJ8Y17P3EG/Wag3OtfIFZTGx4w
21
+ y+QL0OE5c/ox62TS2/2nydpYf5c+YnLv9bnCeX+RJzYUswagmIcu/7cDts2LMGpd
22
+ 8HTUB9boXe7CWOx3wdQzpUYPpu3AzPUqlM5nsb2jjeTI/oL8RmXtUuqajsAV1Y0q
23
+ FYJ/fWI2TmIQgbUYp7qt/4QFCMkCAwEAAaOBijCBhzAJBgNVHRMEAjAAMAsGA1Ud
24
+ DwQEAwIEsDAdBgNVHQ4EFgQU5AX1D9h3V3C69RkW8LLX5fqon/QwJgYDVR0RBB8w
25
+ HYEbZ2VtbWFzdGVyQGphbWVzcm9iZXJ0c29uLmV1MCYGA1UdEgQfMB2BG2dlbW1h
26
+ c3RlckBqYW1lc3JvYmVydHNvbi5ldTANBgkqhkiG9w0BAQUFAAOCAQEAZfMUSAOD
27
+ NtqhVb//qVSOZ1T4YQUxSUksSAa3cskO68TrmXf7OOigHv/zn+fc5DJ3owGZ9w1l
28
+ Kh4e7FTHkt0heRb/PBTYaghtqQIRQ/O7bxVZy29MCgA+jqwKgS7K4FSqhiO6aYWR
29
+ KjBNYAM6/hGCUh5+5UsfpDUGSc9gMX7l1n8TuJp0fK76XqUdloQdhMC7Kt4aFgsq
30
+ 625jXE90+uBvPiaB48wtDcksNvGS3h4IAJo+K+0+p6zZdKxFE4sFrZhftIKR6aY3
31
+ C8VA38E3Zv6BW0qJKU1AtzULrvfSjB6DHafrzks8aANOZ48CMYywrbaiNHG6cJaZ
32
+ 0Hd2sNogoB6McA==
33
+ -----END CERTIFICATE-----
34
+ date: 2017-08-24 00:00:00.000000000 Z
35
+ dependencies:
36
+ - !ruby/object:Gem::Dependency
37
+ name: savon
38
+ requirement: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - "~>"
41
+ - !ruby/object:Gem::Version
42
+ version: '2.11'
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ version: 2.11.2
46
+ type: :runtime
47
+ prerelease: false
48
+ version_requirements: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - "~>"
51
+ - !ruby/object:Gem::Version
52
+ version: '2.11'
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: 2.11.2
56
+ description:
57
+ email: james@jamesrobertson.eu
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - lib/mybustracker.rb
63
+ homepage: https://github.com/jrobertson/mybustracker
64
+ licenses:
65
+ - MIT
66
+ metadata: {}
67
+ post_install_message:
68
+ rdoc_options: []
69
+ require_paths:
70
+ - lib
71
+ required_ruby_version: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ required_rubygems_version: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ version: '0'
81
+ requirements: []
82
+ rubyforge_project:
83
+ rubygems_version: 2.6.8
84
+ signing_key:
85
+ specification_version: 4
86
+ summary: "*Currently under development*. An unoficial gem to query the mybustracker.co.uk
87
+ web service for bus times etc. #edinburgh"
88
+ test_files: []
metadata.gz.sig ADDED
Binary file