summaryrefslogtreecommitdiff
path: root/lib/DBInfoscreen/Helper
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2022-02-13 08:22:01 +0100
committerDaniel Friesel <derf@finalrewind.org>2022-02-13 08:22:01 +0100
commitda4d26146e4f70b7b4a23e54d1f37be7d487138c (patch)
treef8126757c4f15649397720e772a7e23b06811704 /lib/DBInfoscreen/Helper
parente9cf42a1ca048c6653c54f822f45ca64b7b5d474 (diff)
urlescape station names before passing them to marudor.de4.9.1
Diffstat (limited to 'lib/DBInfoscreen/Helper')
-rw-r--r--lib/DBInfoscreen/Helper/Marudor.pm4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/DBInfoscreen/Helper/Marudor.pm b/lib/DBInfoscreen/Helper/Marudor.pm
index f2a58cf..60ab17a 100644
--- a/lib/DBInfoscreen/Helper/Marudor.pm
+++ b/lib/DBInfoscreen/Helper/Marudor.pm
@@ -12,6 +12,7 @@ use DateTime;
use Encode qw(decode encode);
use Mojo::JSON qw(decode_json);
use Mojo::Promise;
+use Mojo::Util qw(url_escape);
use XML::LibXML;
sub new {
@@ -144,6 +145,9 @@ sub get_train_utilization {
return $promise;
}
+ $this_station = url_escape($this_station);
+ $next_station = url_escape($next_station);
+
$self->get_json_p( $self->{realtime_cache},
"https://marudor.de/api/hafas/v2/auslastung/${this_station}/${next_station}/${train_no}/${dep}"
)->then(