cta_track 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/78bus.csv +120 -0
- data/78bus.txt +120 -0
- data/Gemfile +1 -0
- data/example.json +1 -0
- data/lib/api.rb +7 -0
- data/lib/cta_track.rb +2 -0
- data/lib/cta_track/version.rb +1 -1
- data/lib/directions.rb +14 -0
- data/lib/routes.rb +9 -2
- data/lib/stops.rb +28 -0
- metadata +8 -4
- data/cta_track-0.0.1.gem +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 000d4b8d10b38be33b0d64d10d57cec39086ec25
|
|
4
|
+
data.tar.gz: 20f500428b03caf66b3ac48a00d7f267a8c5b6ff
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: aef5acecc403f31b37ec31d65dc670c8b21abf269678c0c2c40753b005797c2fb74f5f0236318ad34d9c6ebcb85525b042c598d02f3f180680feefd599f15c16
|
|
7
|
+
data.tar.gz: 6a8661cb2adff629520636cadde523361730f30e3ad13889d787d00e4add873cd1abf5a93fdc557c3b6aa003f7033f61f04e4bc51e03d98505e23a23dcd285fe
|
data/78bus.csv
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
100.510645177, 5532
|
|
2
|
+
100.510684497, 29723
|
|
3
|
+
100.510698954, 47399
|
|
4
|
+
100.510711246, 60802
|
|
5
|
+
160.767919445, 7519
|
|
6
|
+
160.767998784, 30494
|
|
7
|
+
160.768032448, 47922
|
|
8
|
+
160.768039502, 63278
|
|
9
|
+
220.939564388, 9094
|
|
10
|
+
220.939594909, 32151
|
|
11
|
+
220.939608947, 48011
|
|
12
|
+
220.939621378, 63969
|
|
13
|
+
281.145003573, 10974
|
|
14
|
+
281.145017122, 32323
|
|
15
|
+
281.14502236, 50401
|
|
16
|
+
281.145027109, 65851
|
|
17
|
+
341.335270856, 12000
|
|
18
|
+
341.335284894, 33409
|
|
19
|
+
341.335290412, 51995
|
|
20
|
+
341.33532212, 66773
|
|
21
|
+
401.529738604, 13656
|
|
22
|
+
401.529752293, 33409
|
|
23
|
+
401.52975774, 52803
|
|
24
|
+
401.529781067, 67766
|
|
25
|
+
467.753867596, 15543
|
|
26
|
+
467.753880866, 35005
|
|
27
|
+
467.753886523, 53491
|
|
28
|
+
467.753891481, 68065
|
|
29
|
+
528.02207405, 15543
|
|
30
|
+
528.022086691, 36473
|
|
31
|
+
528.022091999, 54013
|
|
32
|
+
528.022096679, 68426
|
|
33
|
+
588.20263996, 17451
|
|
34
|
+
588.202652392, 36473
|
|
35
|
+
588.202657979, 55161
|
|
36
|
+
588.202662868, 68426
|
|
37
|
+
648.467583849, 18313
|
|
38
|
+
648.467606687, 37552
|
|
39
|
+
648.467616115, 56250
|
|
40
|
+
648.467621423, 68426
|
|
41
|
+
708.679733314, 18792
|
|
42
|
+
708.679750286, 38165
|
|
43
|
+
708.679758248, 58061
|
|
44
|
+
708.679765092, 68503
|
|
45
|
+
768.971968802, 19845
|
|
46
|
+
768.971986751, 38895
|
|
47
|
+
768.971994783, 58061
|
|
48
|
+
768.972001767, 68503
|
|
49
|
+
829.149757543, 22169
|
|
50
|
+
829.149770185, 40496
|
|
51
|
+
829.149775632, 59179
|
|
52
|
+
829.149780591, 68503
|
|
53
|
+
889.412168987, 22433
|
|
54
|
+
889.412197901, 41560
|
|
55
|
+
889.412212289, 60432
|
|
56
|
+
889.412223673, 68503
|
|
57
|
+
954.561712726, 24272
|
|
58
|
+
954.561725856, 42650
|
|
59
|
+
954.561731374, 62759
|
|
60
|
+
954.561736193, 68503
|
|
61
|
+
1015.07184778, 24272
|
|
62
|
+
1015.071862237, 43445
|
|
63
|
+
1015.071869222, 63279
|
|
64
|
+
1015.071874599, 68503
|
|
65
|
+
1075.282366522, 24935
|
|
66
|
+
1075.28238063, 43527
|
|
67
|
+
1075.282386496, 64801
|
|
68
|
+
1075.282391385, 68503
|
|
69
|
+
1135.478607889, 26226
|
|
70
|
+
1135.478624511, 43527
|
|
71
|
+
1135.478632194, 65978
|
|
72
|
+
1135.478639317, 248
|
|
73
|
+
1195.745299137, 26327
|
|
74
|
+
1195.74532826, 45865
|
|
75
|
+
1195.745343067, 67379
|
|
76
|
+
1195.745356895, 248
|
|
77
|
+
1256.024447695, 27534
|
|
78
|
+
1256.024459638, 46196
|
|
79
|
+
1256.024468507, 68375
|
|
80
|
+
1256.024474374, 1793
|
|
81
|
+
1316.209193675, 28228
|
|
82
|
+
1316.209223498, 46913
|
|
83
|
+
1316.209238374, 68425
|
|
84
|
+
1316.209252691, 3123
|
|
85
|
+
1376.46753442, 28320
|
|
86
|
+
1376.467553626, 48315
|
|
87
|
+
1376.467566407, 68546
|
|
88
|
+
1376.467574648, 4759
|
|
89
|
+
1436.682519162, 30215
|
|
90
|
+
1436.682547867, 48831
|
|
91
|
+
1436.682562254, 68546
|
|
92
|
+
1436.682575105, 5740
|
|
93
|
+
1496.865279555, 31002
|
|
94
|
+
1496.865292266, 49253
|
|
95
|
+
1496.865297574, 68546
|
|
96
|
+
1496.865302812, 7118
|
|
97
|
+
1557.054200369, 31873
|
|
98
|
+
1557.054229702, 50378
|
|
99
|
+
1557.05424395, 68546
|
|
100
|
+
1557.054266648, 7775
|
|
101
|
+
1617.238628571, 31873
|
|
102
|
+
1617.238646102, 50826
|
|
103
|
+
1617.238652038, 68546
|
|
104
|
+
1617.238657835, 8740
|
|
105
|
+
1677.51862626, 33394
|
|
106
|
+
1677.518639809, 51745
|
|
107
|
+
1677.518645746, 68546
|
|
108
|
+
1677.518651263, 10865
|
|
109
|
+
1737.702353885, 34705
|
|
110
|
+
1737.702384894, 53950
|
|
111
|
+
1737.702398793, 68546
|
|
112
|
+
1737.702424913, 11183
|
|
113
|
+
1797.897415353, 35812
|
|
114
|
+
1797.897428274, 53950
|
|
115
|
+
1797.897433582, 68546
|
|
116
|
+
1797.89743868, 12534
|
|
117
|
+
1858.665138401, 35812
|
|
118
|
+
1858.665150903, 56169
|
|
119
|
+
1858.665156281, 68546
|
|
120
|
+
1858.665161379, 12925
|
data/78bus.txt
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
100.510645177, 5532
|
|
2
|
+
100.510684497, 29723
|
|
3
|
+
100.510698954, 47399
|
|
4
|
+
100.510711246, 60802
|
|
5
|
+
160.767919445, 7519
|
|
6
|
+
160.767998784, 30494
|
|
7
|
+
160.768032448, 47922
|
|
8
|
+
160.768039502, 63278
|
|
9
|
+
220.939564388, 9094
|
|
10
|
+
220.939594909, 32151
|
|
11
|
+
220.939608947, 48011
|
|
12
|
+
220.939621378, 63969
|
|
13
|
+
281.145003573, 10974
|
|
14
|
+
281.145017122, 32323
|
|
15
|
+
281.14502236, 50401
|
|
16
|
+
281.145027109, 65851
|
|
17
|
+
341.335270856, 12000
|
|
18
|
+
341.335284894, 33409
|
|
19
|
+
341.335290412, 51995
|
|
20
|
+
341.33532212, 66773
|
|
21
|
+
401.529738604, 13656
|
|
22
|
+
401.529752293, 33409
|
|
23
|
+
401.52975774, 52803
|
|
24
|
+
401.529781067, 67766
|
|
25
|
+
467.753867596, 15543
|
|
26
|
+
467.753880866, 35005
|
|
27
|
+
467.753886523, 53491
|
|
28
|
+
467.753891481, 68065
|
|
29
|
+
528.02207405, 15543
|
|
30
|
+
528.022086691, 36473
|
|
31
|
+
528.022091999, 54013
|
|
32
|
+
528.022096679, 68426
|
|
33
|
+
588.20263996, 17451
|
|
34
|
+
588.202652392, 36473
|
|
35
|
+
588.202657979, 55161
|
|
36
|
+
588.202662868, 68426
|
|
37
|
+
648.467583849, 18313
|
|
38
|
+
648.467606687, 37552
|
|
39
|
+
648.467616115, 56250
|
|
40
|
+
648.467621423, 68426
|
|
41
|
+
708.679733314, 18792
|
|
42
|
+
708.679750286, 38165
|
|
43
|
+
708.679758248, 58061
|
|
44
|
+
708.679765092, 68503
|
|
45
|
+
768.971968802, 19845
|
|
46
|
+
768.971986751, 38895
|
|
47
|
+
768.971994783, 58061
|
|
48
|
+
768.972001767, 68503
|
|
49
|
+
829.149757543, 22169
|
|
50
|
+
829.149770185, 40496
|
|
51
|
+
829.149775632, 59179
|
|
52
|
+
829.149780591, 68503
|
|
53
|
+
889.412168987, 22433
|
|
54
|
+
889.412197901, 41560
|
|
55
|
+
889.412212289, 60432
|
|
56
|
+
889.412223673, 68503
|
|
57
|
+
954.561712726, 24272
|
|
58
|
+
954.561725856, 42650
|
|
59
|
+
954.561731374, 62759
|
|
60
|
+
954.561736193, 68503
|
|
61
|
+
1015.07184778, 24272
|
|
62
|
+
1015.071862237, 43445
|
|
63
|
+
1015.071869222, 63279
|
|
64
|
+
1015.071874599, 68503
|
|
65
|
+
1075.282366522, 24935
|
|
66
|
+
1075.28238063, 43527
|
|
67
|
+
1075.282386496, 64801
|
|
68
|
+
1075.282391385, 68503
|
|
69
|
+
1135.478607889, 26226
|
|
70
|
+
1135.478624511, 43527
|
|
71
|
+
1135.478632194, 65978
|
|
72
|
+
1135.478639317, 248
|
|
73
|
+
1195.745299137, 26327
|
|
74
|
+
1195.74532826, 45865
|
|
75
|
+
1195.745343067, 67379
|
|
76
|
+
1195.745356895, 248
|
|
77
|
+
1256.024447695, 27534
|
|
78
|
+
1256.024459638, 46196
|
|
79
|
+
1256.024468507, 68375
|
|
80
|
+
1256.024474374, 1793
|
|
81
|
+
1316.209193675, 28228
|
|
82
|
+
1316.209223498, 46913
|
|
83
|
+
1316.209238374, 68425
|
|
84
|
+
1316.209252691, 3123
|
|
85
|
+
1376.46753442, 28320
|
|
86
|
+
1376.467553626, 48315
|
|
87
|
+
1376.467566407, 68546
|
|
88
|
+
1376.467574648, 4759
|
|
89
|
+
1436.682519162, 30215
|
|
90
|
+
1436.682547867, 48831
|
|
91
|
+
1436.682562254, 68546
|
|
92
|
+
1436.682575105, 5740
|
|
93
|
+
1496.865279555, 31002
|
|
94
|
+
1496.865292266, 49253
|
|
95
|
+
1496.865297574, 68546
|
|
96
|
+
1496.865302812, 7118
|
|
97
|
+
1557.054200369, 31873
|
|
98
|
+
1557.054229702, 50378
|
|
99
|
+
1557.05424395, 68546
|
|
100
|
+
1557.054266648, 7775
|
|
101
|
+
1617.238628571, 31873
|
|
102
|
+
1617.238646102, 50826
|
|
103
|
+
1617.238652038, 68546
|
|
104
|
+
1617.238657835, 8740
|
|
105
|
+
1677.51862626, 33394
|
|
106
|
+
1677.518639809, 51745
|
|
107
|
+
1677.518645746, 68546
|
|
108
|
+
1677.518651263, 10865
|
|
109
|
+
1737.702353885, 34705
|
|
110
|
+
1737.702384894, 53950
|
|
111
|
+
1737.702398793, 68546
|
|
112
|
+
1737.702424913, 11183
|
|
113
|
+
1797.897415353, 35812
|
|
114
|
+
1797.897428274, 53950
|
|
115
|
+
1797.897433582, 68546
|
|
116
|
+
1797.89743868, 12534
|
|
117
|
+
1858.665138401, 35812
|
|
118
|
+
1858.665150903, 56169
|
|
119
|
+
1858.665156281, 68546
|
|
120
|
+
1858.665161379, 12925
|
data/Gemfile
CHANGED
data/example.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"1368":{"vid":1368,"lat":41.740600767589754,"lon":-87.61463928222656,"des":"Michigan/Chicago","heading":345,"pattern_id":5342,"pattern_distance":8605,"rt":3,"delay":"","timestamp":"2016-09-15T20:44:00+00:00"},"7948":{"vid":7948,"lat":41.76217239379883,"lon":-87.61515777587891,"des":"Michigan/Chicago","heading":0,"pattern_id":5342,"pattern_distance":16466,"rt":3,"delay":"","timestamp":"2016-09-15T20:44:00+00:00"},"7929":{"vid":7929,"lat":41.89673500061035,"lon":-87.62244186401367,"des":"Michigan/Chicago","heading":96,"pattern_id":5342,"pattern_distance":67409,"rt":3,"delay":"","timestamp":"2016-09-15T20:43:00+00:00"},"7954":{"vid":7954,"lat":41.89388,"lon":-87.61985666666666,"des":"Michigan/Chicago","heading":177,"pattern_id":5342,"pattern_distance":69085,"rt":3,"delay":"","timestamp":"2016-09-15T20:44:00+00:00"},"1215":{"vid":1215,"lat":41.89680480957031,"lon":-87.62332153320312,"des":"95th/CSU","heading":269,"pattern_id":5343,"pattern_distance":2218,"rt":3,"delay":"","timestamp":"2016-09-15T20:43:00+00:00"},"1267":{"vid":1267,"lat":41.88703851699829,"lon":-87.6245735168457,"des":"95th/CSU","heading":185,"pattern_id":5343,"pattern_distance":6045,"rt":3,"delay":"","timestamp":"2016-09-15T20:44:00+00:00"},"1329":{"vid":1329,"lat":41.86525926589966,"lon":-87.62416076660156,"des":"95th/CSU","heading":172,"pattern_id":5343,"pattern_distance":14050,"rt":3,"delay":"","timestamp":"2016-09-15T20:43:00+00:00"},"7966":{"vid":7966,"lat":41.826897774973226,"lon":-87.61711538991621,"des":"95th/CSU","heading":178,"pattern_id":5343,"pattern_distance":29213,"rt":3,"delay":"","timestamp":"2016-09-15T20:44:00+00:00"},"1248":{"vid":1248,"lat":41.81594906431256,"lon":-87.61683654785156,"des":"95th/CSU","heading":178,"pattern_id":5343,"pattern_distance":33211,"rt":3,"delay":"","timestamp":"2016-09-15T20:44:00+00:00"},"7998":{"vid":7998,"lat":41.78697447343306,"lon":-87.61579270796342,"des":"95th/CSU","heading":179,"pattern_id":5343,"pattern_distance":43816,"rt":3,"delay":"","timestamp":"2016-09-15T20:44:00+00:00"},"7969":{"vid":7969,"lat":41.780412774336966,"lon":-87.61559295654297,"des":"95th/CSU","heading":183,"pattern_id":5343,"pattern_distance":46190,"rt":3,"delay":"","timestamp":"2016-09-15T20:44:00+00:00"},"7933":{"vid":7933,"lat":41.73047744250688,"lon":-87.61441802978516,"des":"95th/CSU","heading":178,"pattern_id":5343,"pattern_distance":64486,"rt":3,"delay":"","timestamp":"2016-09-15T20:41:00+00:00"},"1338":{"vid":1338,"lat":41.726296742757164,"lon":-87.61427307128906,"des":"95th/CSU","heading":178,"pattern_id":5343,"pattern_distance":65252,"rt":3,"delay":"","timestamp":"2016-09-15T20:44:00+00:00"},"1327":{"vid":1327,"lat":41.722982707776524,"lon":-87.61408929657517,"des":"95th/CSU","heading":179,"pattern_id":5343,"pattern_distance":67198,"rt":3,"delay":"","timestamp":"2016-09-15T20:43:00+00:00"},"7944":{"vid":7944,"lat":41.722084045410156,"lon":-87.6032485961914,"des":"Illinois Center","heading":281,"pattern_id":8131,"pattern_distance":14457,"rt":4,"delay":"","timestamp":"2016-09-15T20:44:00+00:00"},"7918":{"vid":7918,"lat":41.789859008789065,"lon":-87.60607147216797,"des":"Illinois Center","heading":359,"pattern_id":8131,"pattern_distance":39436,"rt":4,"delay":"","timestamp":"2016-09-15T20:44:00+00:00"},"1217":{"vid":1217,"lat":41.83028917427523,"lon":-87.61010613498918,"des":"Illinois Center","heading":339,"pattern_id":8131,"pattern_distance":54352,"rt":4,"delay":"","timestamp":"2016-09-15T20:44:00+00:00"},"1241":{"vid":1241,"lat":41.85158414107103,"lon":-87.62371826171875,"des":"Illinois Center","heading":354,"pattern_id":8131,"pattern_distance":65501,"rt":4,"delay":"","timestamp":"2016-09-15T20:43:00+00:00"},"1250":{"vid":1250,"lat":41.88434600830078,"lon":-87.62353649139405,"des":"Illinois Center","heading":93,"pattern_id":8131,"pattern_distance":77615,"rt":4,"delay":"","timestamp":"2016-09-15T20:43:00+00:00"},"1382":{"vid":1382,"lat":41.753789289942326,"lon":-87.60522619283424,"des":"Illinois Center","heading":358,"pattern_id":8134,"pattern_distance":13258,"rt":4,"delay":"","timestamp":"2016-09-15T20:43:00+00:00"},"7906":{"vid":7906,"lat":41.86589267336089,"lon":-87.62397187331626,"des":"115th Street","heading":182,"pattern_id":8136,"pattern_distance":9429,"rt":4,"delay":"","timestamp":"2016-09-15T20:44:00+00:00"},"1259":{"vid":1259,"lat":41.830993166836826,"lon":-87.62127754905008,"des":"115th Street","heading":89,"pattern_id":8136,"pattern_distance":22621,"rt":4,"delay":"","timestamp":"2016-09-15T20:43:00+00:00"},"1293":{"vid":1293,"lat":41.78384599685669,"lon":-87.60606384277344,"des":"115th Street","heading":178,"pattern_id":8136,"pattern_distance":42898,"rt":4,"delay":"","timestamp":"2016-09-15T20:43:00+00:00"},"1356":{"vid":1356,"lat":41.721306920051575,"lon":-87.603355884552,"des":"115th Street","heading":190,"pattern_id":8136,"pattern_distance":66024,"rt":4,"delay":"","timestamp":"2016-09-15T20:44:00+00:00"},"1322":{"vid":1322,"lat":41.70475516520755,"lon":-87.60713571897695,"des":"115th Street","heading":189,"pattern_id":8136,"pattern_distance":72030,"rt":4,"delay":"","timestamp":"2016-09-15T20:44:00+00:00"},"1214":{"vid":1214,"lat":41.687030533612784,"lon":-87.61119364075742,"des":"115th Street","heading":190,"pattern_id":8136,"pattern_distance":78720,"rt":4,"delay":"","timestamp":"2016-09-15T20:44:00+00:00"},"1218":{"vid":1218,"lat":41.886764034148186,"lon":-87.62423878331339,"des":"95th/CSU","heading":209,"pattern_id":8137,"pattern_distance":1718,"rt":4,"delay":"","timestamp":"2016-09-15T20:42:00+00:00"},"1273":{"vid":1273,"lat":41.82286974278892,"lon":-87.60693359375,"des":"95th/CSU","heading":179,"pattern_id":8137,"pattern_distance":28605,"rt":4,"delay":"","timestamp":"2016-09-15T20:44:00+00:00"},"7923":{"vid":7923,"lat":41.75505447387695,"lon":-87.60533905029297,"des":"95th/CSU","heading":187,"pattern_id":8137,"pattern_distance":53414,"rt":4,"delay":"","timestamp":"2016-09-15T20:43:00+00:00"},"4306":{"vid":4306,"lat":41.773468017578125,"lon":-87.57231229894302,"des":"Wacker/Columbus","heading":268,"pattern_id":7106,"pattern_distance":13142,"rt":6,"delay":"","timestamp":"2016-09-15T20:43:00+00:00"},"4314":{"vid":4314,"lat":41.80260467529297,"lon":-87.58597183227539,"des":"Wacker/Columbus","heading":267,"pattern_id":7106,"pattern_distance":28317,"rt":6,"delay":"","timestamp":"2016-09-15T20:43:00+00:00"},"4192":{"vid":4192,"lat":41.888423919677734,"lon":-87.62503051757812,"des":"79th/South Shore","heading":259,"pattern_id":7107,"pattern_distance":1074,"rt":6,"delay":"","timestamp":"2016-09-15T20:43:00+00:00"},"4307":{"vid":4307,"lat":41.88552179336548,"lon":-87.62803287506104,"des":"79th/South Shore","heading":176,"pattern_id":7107,"pattern_distance":2602,"rt":6,"delay":"","timestamp":"2016-09-15T20:44:00+00:00"},"4304":{"vid":4304,"lat":41.817108154296875,"lon":-87.59545135498047,"des":"79th/South Shore","heading":153,"pattern_id":7107,"pattern_distance":30956,"rt":6,"delay":"","timestamp":"2016-09-15T20:44:00+00:00"},"4305":{"vid":4305,"lat":41.79277893592571,"lon":-87.58398989973396,"des":"79th/South Shore","heading":176,"pattern_id":7107,"pattern_distance":41899,"rt":6,"delay":"","timestamp":"2016-09-15T20:43:00+00:00"},"4310":{"vid":4310,"lat":41.779899455882884,"lon":-87.58654022216797,"des":"79th/South Shore","heading":172,"pattern_id":7107,"pattern_distance":47146,"rt":6,"delay":"","timestamp":"2016-09-15T20:44:00+00:00"},"4303":{"vid":4303,"lat":41.77978609429031,"lon":-87.58654022216797,"des":"79th/South Shore","heading":177,"pattern_id":7107,"pattern_distance":47191,"rt":6,"delay":"","timestamp":"2016-09-15T20:44:00+00:00"},"4301":{"vid":4301,"lat":41.75199277636031,"lon":-87.54802048374229,"des":"79th/South Shore","heading":132,"pattern_id":7107,"pattern_distance":65002,"rt":6,"delay":"","timestamp":"2016-09-15T20:44:00+00:00"},"4193":{"vid":4193,"lat":41.75104904174805,"lon":-87.54441574384582,"des":"79th/South Shore","heading":103,"pattern_id":7107,"pattern_distance":65998,"rt":6,"delay":"","timestamp":"2016-09-15T20:42:00+00:00"},"1677":{"vid":1677,"lat":41.87386703491211,"lon":-87.68648529052734,"des":"Congress Plaza","heading":97,"pattern_id":4361,"pattern_distance":22762,"rt":7,"delay":"","timestamp":"2016-09-15T20:44:00+00:00"},"1819":{"vid":1819,"lat":41.8780517578125,"lon":-87.6369010925293,"des":"Congress Plaza","heading":89,"pattern_id":4361,"pattern_distance":39229,"rt":7,"delay":"","timestamp":"2016-09-15T20:44:00+00:00"},"1827":{"vid":1827,"lat":41.878168773651126,"lon":-87.62751903533936,"des":"Congress Plaza","heading":78,"pattern_id":4361,"pattern_distance":41837,"rt":7,"delay":"","timestamp":"2016-09-15T20:43:00+00:00"},"1829":{"vid":1829,"lat":41.87443323135376,"lon":-87.64187240600586,"des":"Central","heading":265,"pattern_id":5912,"pattern_distance":8551,"rt":7,"delay":"","timestamp":"2016-09-15T20:44:00+00:00"},"1612":{"vid":1612,"lat":41.8738296241091,"lon":-87.7012531213593,"des":"Central","heading":266,"pattern_id":5912,"pattern_distance":26389,"rt":7,"delay":"","timestamp":"2016-09-15T20:44:00+00:00"},"1639":{"vid":1639,"lat":41.872565,"lon":-87.76486666666666,"des":"Central","heading":354,"pattern_id":5912,"pattern_distance":44981,"rt":7,"delay":"","timestamp":"2016-09-15T20:43:00+00:00"},"1268":{"vid":1268,"lat":41.94728088378906,"lon":-87.64933268229167,"des":"79th","heading":180,"pattern_id":7481,"pattern_distance":1211,"rt":8,"delay":"","timestamp":"2016-09-15T20:43:00+00:00"},"1232":{"vid":1232,"lat":41.91793521245321,"lon":-87.64838960435655,"des":"79th","heading":172,"pattern_id":7481,"pattern_distance":11868,"rt":8,"delay":"","timestamp":"2016-09-15T20:44:00+00:00"},"7996":{"vid":7996,"lat":41.89099588394165,"lon":-87.64762115478516,"des":"79th","heading":175,"pattern_id":7481,"pattern_distance":21753,"rt":8,"delay":"","timestamp":"2016-09-15T20:43:00+00:00"},"1369":{"vid":1369,"lat":41.877820587158205,"lon":-87.64729309082031,"des":"79th","heading":175,"pattern_id":7481,"pattern_distance":26498,"rt":8,"delay":"","timestamp":"2016-09-15T20:43:00+00:00"},"1302":{"vid":1302,"lat":41.82704243894483,"lon":-87.64604949951172,"des":"79th","heading":175,"pattern_id":7481,"pattern_distance":46277,"rt":8,"delay":"","timestamp":"2016-09-15T20:44:00+00:00"},"7985":{"vid":7985,"lat":41.803293228149414,"lon":-87.64543914794922,"des":"79th","heading":178,"pattern_id":7481,"pattern_distance":54965,"rt":8,"delay":"","timestamp":"2016-09-15T20:43:00+00:00"},"1213":{"vid":1213,"lat":41.80186424255371,"lon":-87.64541702270508,"des":"79th","heading":177,"pattern_id":7481,"pattern_distance":55486,"rt":8,"delay":"","timestamp":"2016-09-15T20:44:00+00:00"},"1380":{"vid":1380,"lat":41.756011199951175,"lon":-87.64412689208984,"des":"Waveland/Broadway","heading":359,"pattern_id":7486,"pattern_distance":2404,"rt":8,"delay":"","timestamp":"2016-09-15T20:44:00+00:00"},"1297":{"vid":1297,"lat":41.81504015855386,"lon":-87.6456527709961,"des":"Waveland/Broadway","heading":359,"pattern_id":7486,"pattern_distance":23888,"rt":8,"delay":"","timestamp":"2016-09-15T20:44:00+00:00"},"1298":{"vid":1298,"lat":41.86253321170807,"lon":-87.64681506156921,"des":"Waveland/Broadway","heading":353,"pattern_id":7486,"pattern_distance":42623,"rt":8,"delay":"","timestamp":"2016-09-15T20:44:00+00:00"},"7947":{"vid":7947,"lat":41.89150731703814,"lon":-87.64754486083984,"des":"Waveland/Broadway","heading":358,"pattern_id":7486,"pattern_distance":53244,"rt":8,"delay":"","timestamp":"2016-09-15T20:44:00+00:00"},"7992":{"vid":7992,"lat":41.931753331964664,"lon":-87.64894104003906,"des":"Waveland/Broadway","heading":358,"pattern_id":7486,"pattern_distance":68042,"rt":8,"delay":"","timestamp":"2016-09-15T20:43:00+00:00"},"1280":{"vid":1280,"lat":41.94715287255459,"lon":-87.64944157834913,"des":"Waveland/Broadway","heading":10,"pattern_id":7486,"pattern_distance":73659,"rt":8,"delay":"","timestamp":"2016-09-15T20:43:00+00:00"},"1296":{"vid":1296,"lat":41.67828369140625,"lon":-87.64178466796875,"des":"79th Red Line","heading":355,"pattern_id":7131,"pattern_distance":796,"rt":8,"delay":"","timestamp":"2016-09-15T20:44:00+00:00"},"8083":{"vid":8083,"lat":41.72100830078125,"lon":-87.66261291503906,"des":"74th","heading":356,"pattern_id":3637,"pattern_distance":346,"rt":9,"delay":"","timestamp":"2016-09-15T20:44:00+00:00"},"8028":{"vid":8028,"lat":41.73454666137695,"lon":-87.66294860839844,"des":"74th","heading":59,"pattern_id":3637,"pattern_distance":5294,"rt":9,"delay":"","timestamp":"2016-09-15T20:43:00+00:00"},"1467":{"vid":1467,"lat":41.90634613037109,"lon":-87.66761779785156,"des":"95th","heading":178,"pattern_id":7494,"pattern_distance":20361,"rt":9,"delay":"","timestamp":"2016-09-15T20:44:00+00:00"},"8041":{"vid":8041,"lat":41.88774662017822,"lon":-87.66710662841797,"des":"95th","heading":180,"pattern_id":7494,"pattern_distance":27150,"rt":9,"delay":"","timestamp":"2016-09-15T20:43:00+00:00"},"8024":{"vid":8024,"lat":41.869781766619,"lon":-87.66656167166573,"des":"95th","heading":178,"pattern_id":7494,"pattern_distance":33696,"rt":9,"delay":"","timestamp":"2016-09-15T20:42:00+00:00"},"8075":{"vid":8075,"lat":41.81157808303833,"lon":-87.66513061523438,"des":"95th","heading":174,"pattern_id":7494,"pattern_distance":55606,"rt":9,"delay":"","timestamp":"2016-09-15T20:44:00+00:00"},"8025":{"vid":8025,"lat":41.78416585922241,"lon":-87.66440486907959,"des":"95th","heading":179,"pattern_id":7494,"pattern_distance":65952,"rt":9,"delay":"","timestamp":"2016-09-15T20:43:00+00:00"},"8001":{"vid":8001,"lat":41.76793251037598,"lon":-87.66392517089844,"des":"95th","heading":177,"pattern_id":7494,"pattern_distance":71895,"rt":9,"delay":"","timestamp":"2016-09-15T20:44:00+00:00"},"8092":{"vid":8092,"lat":41.72041,"lon":-87.66305833333334,"des":"95th","heading":166,"pattern_id":7494,"pattern_distance":89387,"rt":9,"delay":"","timestamp":"2016-09-15T20:44:00+00:00"},"8052":{"vid":8052,"lat":41.7677648016747,"lon":-87.66373281275972,"des":"Irving Park","heading":357,"pattern_id":7501,"pattern_distance":17324,"rt":9,"delay":"","timestamp":"2016-09-15T20:44:00+00:00"},"8073":{"vid":8073,"lat":41.80730883280436,"lon":-87.66484832763672,"des":"Irving Park","heading":355,"pattern_id":7501,"pattern_distance":31715,"rt":9,"delay":"","timestamp":"2016-09-15T20:44:00+00:00"},"1437":{"vid":1437,"lat":41.8561822014886,"lon":-87.66596448743665,"des":"Irving Park","heading":358,"pattern_id":7501,"pattern_distance":50267,"rt":9,"delay":"","timestamp":"2016-09-15T20:44:00+00:00"},"8097":{"vid":8097,"lat":41.93921394348145,"lon":-87.66849822998047,"des":"Irving Park","heading":1,"pattern_id":7502,"pattern_distance":87491,"rt":9,"delay":"","timestamp":"2016-09-15T20:44:00+00:00"}}
|
data/lib/api.rb
CHANGED
|
@@ -42,5 +42,12 @@ module CtaTrack
|
|
|
42
42
|
routes.to_s
|
|
43
43
|
end
|
|
44
44
|
end
|
|
45
|
+
|
|
46
|
+
def self.directions(route)
|
|
47
|
+
nokorequest("#{@@baseurl}getdirections?key=#{@@apikey}&rt=#{route}&format=json")
|
|
48
|
+
end
|
|
49
|
+
def self.stops(args)
|
|
50
|
+
nokorequest("#{@@baseurl}getstops?key=#{@@apikey}&rt=#{args[:route]}&dir=#{args[:direction]}&format=json")
|
|
51
|
+
end
|
|
45
52
|
end
|
|
46
53
|
end
|
data/lib/cta_track.rb
CHANGED
data/lib/cta_track/version.rb
CHANGED
data/lib/directions.rb
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
module CtaTrack
|
|
2
|
+
class Directions
|
|
3
|
+
def initialize(args)
|
|
4
|
+
raise ArgumentError, "must enter api key" if API.apikey.nil?
|
|
5
|
+
@result = []
|
|
6
|
+
API.directions(args).root.xpath("dir").each do |node|
|
|
7
|
+
@result << node.text
|
|
8
|
+
end
|
|
9
|
+
end
|
|
10
|
+
def dir
|
|
11
|
+
@result
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
data/lib/routes.rb
CHANGED
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
module CtaTrack
|
|
2
|
-
class
|
|
2
|
+
class RouteFactory
|
|
3
3
|
attr_reader :result
|
|
4
4
|
def initialize(**args)
|
|
5
5
|
raise ArgumentError, "must enter api key" if API.apikey.nil?
|
|
6
6
|
@result = {}
|
|
7
7
|
API.routes.root.xpath("route").each do |node|
|
|
8
|
-
@result[node.xpath('rt').text] = {:number=> node.xpath('rt').text, :name=> node.xpath('rtnm').text
|
|
8
|
+
@result[node.xpath('rt').text] = Route.new({:number=> node.xpath('rt').text, :name=> node.xpath('rtnm').text})
|
|
9
9
|
end
|
|
10
10
|
end
|
|
11
11
|
end
|
|
12
|
+
class Route
|
|
13
|
+
attr_reader :number, :name
|
|
14
|
+
def initialize(args)
|
|
15
|
+
@number = args[:number]
|
|
16
|
+
@name = args[:name]
|
|
17
|
+
end
|
|
18
|
+
end
|
|
12
19
|
end
|
data/lib/stops.rb
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
module CtaTrack
|
|
2
|
+
class Stops
|
|
3
|
+
attr_reader :stops, :result
|
|
4
|
+
def initialize(args)
|
|
5
|
+
raise ArgumentError, "must enter api key" if API.apikey.nil?
|
|
6
|
+
@result = {}
|
|
7
|
+
@stops = []
|
|
8
|
+
API.stops(args).root.xpath("stop").each do |node|
|
|
9
|
+
@result[node.xpath('stpid').text.to_i] = {
|
|
10
|
+
:stpid => node.xpath("stpid").text.to_i,
|
|
11
|
+
:stpnm => node.xpath("stpnm").text,
|
|
12
|
+
:lat => node.xpath("lat").text.to_i,
|
|
13
|
+
:lon => node.xpath("lon").text.to_i
|
|
14
|
+
}
|
|
15
|
+
@stops << node.xpath("stpnm").text
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
def keys
|
|
19
|
+
@result.keys
|
|
20
|
+
end
|
|
21
|
+
def method_missing(method_name, stop, *arguments, &block)
|
|
22
|
+
@result[stop][method_name.to_sym]
|
|
23
|
+
end
|
|
24
|
+
def respond_to?(method_name, include_private=false)
|
|
25
|
+
@result[@result.keys[0]].include?("#{method_name}".to_sym)
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cta_track
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- rdalin82
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-
|
|
11
|
+
date: 2016-12-21 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -62,6 +62,8 @@ extra_rdoc_files: []
|
|
|
62
62
|
files:
|
|
63
63
|
- ".gitignore"
|
|
64
64
|
- ".travis.yml"
|
|
65
|
+
- 78bus.csv
|
|
66
|
+
- 78bus.txt
|
|
65
67
|
- CODE_OF_CONDUCT.md
|
|
66
68
|
- Gemfile
|
|
67
69
|
- LICENSE.txt
|
|
@@ -69,13 +71,15 @@ files:
|
|
|
69
71
|
- Rakefile
|
|
70
72
|
- bin/console
|
|
71
73
|
- bin/setup
|
|
72
|
-
- cta_track-0.0.1.gem
|
|
73
74
|
- cta_track.gemspec
|
|
75
|
+
- example.json
|
|
74
76
|
- lib/api.rb
|
|
75
77
|
- lib/cta_track.rb
|
|
76
78
|
- lib/cta_track/version.rb
|
|
79
|
+
- lib/directions.rb
|
|
77
80
|
- lib/predictions.rb
|
|
78
81
|
- lib/routes.rb
|
|
82
|
+
- lib/stops.rb
|
|
79
83
|
- lib/vehicles.rb
|
|
80
84
|
homepage: https://github.com/rdalin82/CtaTrack
|
|
81
85
|
licenses:
|
|
@@ -97,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
97
101
|
version: '0'
|
|
98
102
|
requirements: []
|
|
99
103
|
rubyforge_project:
|
|
100
|
-
rubygems_version: 2.
|
|
104
|
+
rubygems_version: 2.5.1
|
|
101
105
|
signing_key:
|
|
102
106
|
specification_version: 4
|
|
103
107
|
summary: This is a gem that interacts with CTA's public bus API
|
data/cta_track-0.0.1.gem
DELETED
|
Binary file
|