%= stylesheet '/static/main.css' %= javascript '/static/jquery-2.1.1.min.js' %= javascript '/static/image.js' % if ($stop) { % if ($errstr) {
Received an error from the backend service:
%= $errstr
% } % elsif ($frontend eq 'png') { <%= $stop %>.png?<%= $params %>" alt="" id="display" height="<%= $height * 4 %>" width="<%= $width * 4 %>"/> % } % elsif ($frontend eq 'html') { % } % elsif ($frontend eq 'infoscreen') {

<%= $stop %>.html?<%= $params %>&template=infoscreen">Infoscreen for <%= $city %> <%= $stop %>

Preview:
% } % elsif ($frontend eq 'json') {

<%= $stop %>.json?<%= $params %>">JSON data for <%= $city %> <%= $stop %>

Data is cached for 1 minute. JSON format:

NOTE: The JSON interface is not guaranteed to be stable. The data layout may change any time.

% } % } # ($stop) % else {

VRR-Infoscreen shows the next departures at a public transit stop, just like the Lumino LED displays used in some places. It also supports an app / infoscreen-like frontend (click/tap on a departure for details) and JSON export.

It works best for the VRR (Verkehrsverbund Rhein-Ruhr), but also supports many other german transit networks. All information is provided without any guarantee of correctness, completeness or anything else.

% }
% if (my $error = stash 'error') {

Error: <%= $error %>

% } %= form_for _redirect => begin
City (required for EFA backend, optional otherwise)
% if (stash('place_candidates') and @{ stash('place_candidates') } ) { % my @candidates = map { [ $_, $_ ] } @{ stash('place_candidates') }; %= select_field city => \@candidates % } % else { %= text_field 'city' % }
Stop
% if (stash('name_candidates') and @{ stash('name_candidates') } ) { % my @candidates = map { [ $_, $_ ] } @{ stash('name_candidates') }; %= select_field stop => \@candidates % } % else { %= text_field 'stop' % }
%= submit_button 'Display'
optional:
Frontend
%= select_field frontend => [['LED board (PNG)' => 'png'], ['LED board (HTML)' => 'html'], ['App / Infoscreen' => 'infoscreen'], ['JSON' => 'json']]
Backend
% my @efa_backends = map { ["$_ (EFA)" => "efa.$_"] } efa_service_list(); % @efa_backends = map { $_->[1] } sort { $a->[0] cmp $b->[0] } % map { [$_->[0], $_] } @efa_backends; % my @hafas_backends = map { ["$_ (HAFAS)" => "hafas.$_"] } hafas_service_list(); % @hafas_backends = map { $_->[1] } sort { $a->[0] cmp $b->[0] } % map { [$_->[0], $_] } @hafas_backends; %= select_field backend => [['EFA / VRR' => 'vrr'], ['DB (HAFAS)' => 'db'], ['ASEAG (URA)' => 'aseag'], @efa_backends, @hafas_backends]
display height [lines]
%= number_field 'no_lines', min => 1, max => 10
min. offset [minutes]
%= number_field 'offset', min => 0
match line prefixes¹
%= text_field 'line'
match platform¹
%= text_field 'platform'
% end

¹ separate values with commas, e.g. NE,U,10

notes:
vrr-fakedisplay v<%= $version %>
Backends:
Travel::Status::DE::URA v<%= $Travel::Status::DE::ASEAG::VERSION %>
Travel::Status::DE::HAFAS v<%= $Travel::Status::DE::HAFAS::VERSION %>
Travel::Status::DE::EFA v<%= $Travel::Status::DE::EFA::VERSION %>