national-rail 0.4.7 → 0.4.8
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/national-rail/journey_planner.rb +39 -5
- metadata +4 -4
@@ -23,6 +23,36 @@ module NationalRail
|
|
23
23
|
|
24
24
|
class JourneyPlanner
|
25
25
|
|
26
|
+
OPERATORS = {
|
27
|
+
"Arriva Trains Wales" => "AW",
|
28
|
+
"c2c" => "CC",
|
29
|
+
"Chiltern Railways" => "CH",
|
30
|
+
"CrossCountry" => "XC",
|
31
|
+
"East Coast" => "GR",
|
32
|
+
"East Midlands Trains" => "EM",
|
33
|
+
"First Capital Connect" => "FC",
|
34
|
+
"First Great Western" => "GW",
|
35
|
+
"First ScotRail" => "SR",
|
36
|
+
"Gatwick Express" => "GX",
|
37
|
+
"Grand Central Railway" => "GC",
|
38
|
+
"Heathrow Connect" => "HC",
|
39
|
+
"Heathrow Express" => "HX",
|
40
|
+
"Hull Trains" => "HT",
|
41
|
+
"Island Line" => "IL",
|
42
|
+
"London Midland" => "LM",
|
43
|
+
"London Overground" => "LO",
|
44
|
+
"London Underground" => "LT",
|
45
|
+
"Merseyrail" => "ME",
|
46
|
+
"Northern Rail" => "NT",
|
47
|
+
"NXEA" => "LE",
|
48
|
+
"South West Trains" => "SW",
|
49
|
+
"Southeastern" => "SE",
|
50
|
+
"Southern" => "SN",
|
51
|
+
"Transpennine Express" => "TP",
|
52
|
+
"Virgin Trains" => "VT",
|
53
|
+
"Wrexham and Shropshire Railway" => "WS"
|
54
|
+
}
|
55
|
+
|
26
56
|
class << self
|
27
57
|
attr_accessor :capture_path
|
28
58
|
def capture(page, filename)
|
@@ -125,12 +155,16 @@ module NationalRail
|
|
125
155
|
form["viaMode"] = "VIA"
|
126
156
|
form["via.searchTerm"] = ""
|
127
157
|
form["offSetOption"] = "0"
|
128
|
-
form["
|
129
|
-
form["
|
158
|
+
form["reduceTransfers"] = "true"
|
159
|
+
form["_reduceTransfers"] = "on" # hidden (duplicate of reduceTransfers?)
|
160
|
+
form["operatorMode"] = "SHOW" # alternative is "DONT_SHOW"
|
130
161
|
form["operator.code"] = ""
|
131
|
-
form["
|
132
|
-
form["
|
133
|
-
form["
|
162
|
+
form["lookForSleeper"] = "true"
|
163
|
+
form["_lookForSleeper"] = "on" # hidden (duplicate of lookForSleeper?)
|
164
|
+
form["directTrains"] = "true"
|
165
|
+
form["_directTrains"] = "on" # hidden (duplicate of directTrains?)
|
166
|
+
form["includeOvertakenTrains"] = "true"
|
167
|
+
form["_includeOvertakenTrains"] = "on" # hidden (duplicate of includeOvertakenTrains?)
|
134
168
|
end.click_button(button)
|
135
169
|
|
136
170
|
JourneyPlanner.capture(times_page, "summary.html")
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: national-rail
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 0.4.
|
9
|
+
- 8
|
10
|
+
version: 0.4.8
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- James Mead
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-01-
|
18
|
+
date: 2011-01-03 00:00:00 +00:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|