bart_waiting_list 0.0.1 → 0.0.2
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/bart_waiting_list.gemspec +1 -1
- data/lib/bart_waiting_list.rb +8 -34
- data/stations.yaml +32 -0
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 97c3260e87eae7cd17841ec69b826c4390ca80ac
|
|
4
|
+
data.tar.gz: d989dffb180d3f9bd59e32a9642cb375c626a687
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 69fce343ec7d8a216325585598d368e6dd2c2e61dff3517721a06d180456aec06f0279a5ff0a090693b35890d026bb690b9a1c3596b635afe0bba1af11a3cec4
|
|
7
|
+
data.tar.gz: ae80174864f1c8c0fa93950ffa92a7fcd2168d4b2d0359fec84436508f799711342e0c7ec134ada17cb2f4e48e28ec36419aea056ab3255b3b0e0325e73d07fe
|
data/bart_waiting_list.gemspec
CHANGED
|
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
|
4
4
|
|
|
5
5
|
Gem::Specification.new do |spec|
|
|
6
6
|
spec.name = 'bart_waiting_list'
|
|
7
|
-
spec.version = '0.0.
|
|
7
|
+
spec.version = '0.0.2'
|
|
8
8
|
spec.authors = ["Brian O'Keefe"]
|
|
9
9
|
spec.email = ['brian@bokstuff.com']
|
|
10
10
|
spec.summary = %q{Get data from the BART select-a-spot waiting list page}
|
data/lib/bart_waiting_list.rb
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
require 'mechanize'
|
|
2
|
+
require 'yaml'
|
|
2
3
|
|
|
3
4
|
HOME_URL = 'https://www.select-a-spot.com/bart/'
|
|
4
5
|
WAITING_LIST_URL = 'https://www.select-a-spot.com/bart/waiting_lists/'
|
|
@@ -51,39 +52,12 @@ class BartWaitingList
|
|
|
51
52
|
end
|
|
52
53
|
|
|
53
54
|
def get_station_name(station)
|
|
54
|
-
{
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
:daly_city => 'Daly City Station',
|
|
62
|
-
:dublin_pleasanton => 'Dublin/Pleasanton Station',
|
|
63
|
-
:el_cerrito_del_norte => 'El Cerrito del Norte Station',
|
|
64
|
-
:el_cerrito_plaza => 'El Cerrito Plaza Station',
|
|
65
|
-
:fremont => 'Fremont Station',
|
|
66
|
-
:fruitvale => 'Fruitvale Station',
|
|
67
|
-
:hayward => 'Hayward Station',
|
|
68
|
-
:lafayette => 'Lafayette Station',
|
|
69
|
-
:lake_merritt => 'Lake Merritt Station',
|
|
70
|
-
:macarthur => 'MacArthur Station',
|
|
71
|
-
:millbrae => 'Millbrae Station',
|
|
72
|
-
:north_berkeley => 'North Berkeley Station',
|
|
73
|
-
:north_concord_martinez => 'North Concord/Martinez Station',
|
|
74
|
-
:orinda => 'Orinda Station',
|
|
75
|
-
:pittsburg_bay_point => 'Pittsburg/Bay Point Station',
|
|
76
|
-
:pleasant_hill_contra_costa_centre => 'Pleasant Hill/Contra Costa Centre Station',
|
|
77
|
-
:richmond => 'Richmond Station',
|
|
78
|
-
:rockridge => 'Rockridge Station',
|
|
79
|
-
:san_bruno => 'San Bruno Station',
|
|
80
|
-
:san_leandro => 'San Leandro Station',
|
|
81
|
-
:south_hayward => 'South Hayward Station',
|
|
82
|
-
:south_san_francisco => 'South San Francisco Station',
|
|
83
|
-
:union_city => 'Union City Station',
|
|
84
|
-
:walnut_creek => 'Walnut Creek Station',
|
|
85
|
-
:west_dublin_dublin => 'West Dublin Station - Dublin',
|
|
86
|
-
:west_dublin_pleasanton => 'West Dublin Station - Pleasanton'
|
|
87
|
-
}[station]
|
|
55
|
+
station_names = {}
|
|
56
|
+
|
|
57
|
+
YAML.load_file('stations.yaml').each do |key, value|
|
|
58
|
+
station_names[key.to_sym] = value
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
return station_names[station]
|
|
88
62
|
end
|
|
89
63
|
end
|
data/stations.yaml
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
ashby: Ashby Station
|
|
2
|
+
bay_fair: Bay Fair Station
|
|
3
|
+
castro_valley: Castro Valley Station
|
|
4
|
+
coliseum_oakland_airport: Coliseum/Oakland Airport Station
|
|
5
|
+
colma: Colma Station
|
|
6
|
+
concord: Concord Station
|
|
7
|
+
daly_city: Daly City Station
|
|
8
|
+
dublin_pleasanton: Dublin/Pleasanton Station
|
|
9
|
+
el_cerrito_del_norte: El Cerrito del Norte Station
|
|
10
|
+
el_cerrito_plaza: El Cerrito Plaza Station
|
|
11
|
+
fremont: Fremont Station
|
|
12
|
+
fruitvale: Fruitvale Station
|
|
13
|
+
hayward: Hayward Station
|
|
14
|
+
lafayette: Lafayette Station
|
|
15
|
+
lake_merritt: Lake Merritt Station
|
|
16
|
+
macarthur: MacArthur Station
|
|
17
|
+
millbrae: Millbrae Station
|
|
18
|
+
north_berkeley: North Berkeley Station
|
|
19
|
+
north_concord_martinez: North Concord/Martinez Station
|
|
20
|
+
orinda: Orinda Station
|
|
21
|
+
pittsburg_bay_point: Pittsburg/Bay Point Station
|
|
22
|
+
pleasant_hill_contra_costa_centre: Pleasant Hill/Contra Costa Centre Station
|
|
23
|
+
richmond: Richmond Station
|
|
24
|
+
rockridge: Rockridge Station
|
|
25
|
+
san_bruno: San Bruno Station
|
|
26
|
+
san_leandro: San Leandro Station
|
|
27
|
+
south_hayward: South Hayward Station
|
|
28
|
+
south_san_francisco: South San Francisco Station
|
|
29
|
+
union_city: Union City Station
|
|
30
|
+
walnut_creek: Walnut Creek Station
|
|
31
|
+
west_dublin_dublin: West Dublin Station - Dublin
|
|
32
|
+
west_dublin_pleasanton: West Dublin Station - Pleasanton
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: bart_waiting_list
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Brian O'Keefe
|
|
@@ -98,6 +98,7 @@ files:
|
|
|
98
98
|
- lib/bart_waiting_list.rb
|
|
99
99
|
- spec/bart_waiting_list_spec.rb
|
|
100
100
|
- spec/spec_helper.rb
|
|
101
|
+
- stations.yaml
|
|
101
102
|
homepage: https://github.com/brianokeefe/bart_waiting_list
|
|
102
103
|
licenses:
|
|
103
104
|
- MIT
|