diff options
author | Daniel Friesel <derf@finalrewind.org> | 2022-02-13 08:22:01 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2022-02-13 08:22:01 +0100 |
commit | da4d26146e4f70b7b4a23e54d1f37be7d487138c (patch) | |
tree | f8126757c4f15649397720e772a7e23b06811704 /lib/DBInfoscreen/Helper | |
parent | e9cf42a1ca048c6653c54f822f45ca64b7b5d474 (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.pm | 4 |
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( |