summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2016-05-09 20:49:29 +0200
committerDaniel Friesel <derf@finalrewind.org>2016-05-09 20:49:29 +0200
commitdce8472ad375624287c7e5c1dd80ea0d53e7e678 (patch)
treedf4051292f9a033bc9cef0d8df5106bc71f49ada /scripts
parent2bb64f91d3dc628728bb9de3a9c3888462f66eb2 (diff)
Switch to Deutsche Bahn Haltestellen list
Note that this does NOT include stations outside of germany, even if they have Deutsche Bahn trains. This may be fixed in another commit.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/acronyms.pl8
-rwxr-xr-xscripts/acronyms.sh2
2 files changed, 5 insertions, 5 deletions
diff --git a/scripts/acronyms.pl b/scripts/acronyms.pl
index 9a32783..124034e 100755
--- a/scripts/acronyms.pl
+++ b/scripts/acronyms.pl
@@ -34,19 +34,19 @@ while (my $line = <STDIN>) {
my $status = $csv->parse($line);
my @fields = $csv->fields;
- if ($fields[0] eq 'Abk') {
+ my ($uic, $station, $name, $mot, $longitute, $latitude) = @fields;
+
+ if ($station eq 'DS100' or $station eq q{}) {
next;
}
- my ($station, $name, $country, $location, $valid_since) = @fields;
-
$name =~ s{!}{ }g;
$name =~ s{^\s+}{};
$name =~ s{\s+$}{};
$name =~ s{\s+}{ }g;
$name =~ s{'}{\\'}g;
- printf("\t['%s','%s'],\n", encode('UTF-8', $station), encode('UTF-8', $name));
+ printf("\t['%s','%s',%s,%s,%s],\n", encode('UTF-8', $station), encode('UTF-8', $name), $uic, $longitute, $latitude);
}
say <<'EOF';
diff --git a/scripts/acronyms.sh b/scripts/acronyms.sh
index 57b48ce..908f7d8 100755
--- a/scripts/acronyms.sh
+++ b/scripts/acronyms.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-curl -s http://data.deutschebahn.com/datasets/betriebsstellen/DBNetz-Betriebsstellenverzeichnis-Stand2015-05.csv \
+curl -s http://data.deutschebahn.com/datasets/haltestellen/D_Bahnhof_2016_01_alle.csv \
| perl scripts/acronyms.pl \
> lib/Travel/Status/DE/IRIS/Stations.pm