summaryrefslogtreecommitdiff
path: root/share/enhance
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2022-04-02 21:38:02 +0200
committerDaniel Friesel <derf@finalrewind.org>2022-04-02 21:38:02 +0200
commit63e2b766f2b426c40cde55c109c835bc164a35f3 (patch)
treebee00257de87c1624d009a04c04ad27ccd61a616 /share/enhance
parentddcf0dc6591775c864ce9785ba70563cdff15f8a (diff)
enhance: switch to transport.rest (better support for non-german stations)
Diffstat (limited to 'share/enhance')
-rwxr-xr-xshare/enhance8
1 files changed, 5 insertions, 3 deletions
diff --git a/share/enhance b/share/enhance
index 92428e9..2f0a4a4 100755
--- a/share/enhance
+++ b/share/enhance
@@ -19,9 +19,11 @@ for my $station ( @{$stations} ) {
if ( not $station->{latlong} ) {
say "Requesting location for $station->{name} ...";
my $res = $ua->get(
- sprintf('https://marudor.de/api/station/v1/station/%07d', $station->{eva}) );
+ sprintf( 'https://v5.db.transport.rest/stops/%07d',
+ $station->{eva} )
+ );
if ( $res->is_error ) {
- say ' marudor.de returned error ' . $res->status_line;
+ say ' transport.rest returned error ' . $res->status_line;
}
else {
my $content = $res->decoded_content;
@@ -31,7 +33,7 @@ for my $station ( @{$stations} ) {
$json->{location}{longitude} ];
}
else {
- say ' marudor.de has no location';
+ say ' transport.rest has no location';
}
}
}