diff options
author | Daniel Friesel <derf@finalrewind.org> | 2021-12-12 16:38:26 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2021-12-12 16:38:26 +0100 |
commit | 2e5a1b0a79e3a54e159cf598b2a0d398109a7bf4 (patch) | |
tree | 0ca5f09596a5471f6fe1a88fcb1c10c08a5fb87e /lib | |
parent | a897144459b48e26f5df87051a33b03973030d69 (diff) |
DBDB: only use apps-bahn wagon order API for now
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Travelynx/Helper/DBDB.pm | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/Travelynx/Helper/DBDB.pm b/lib/Travelynx/Helper/DBDB.pm index 4baf3ed..fbee1b9 100644 --- a/lib/Travelynx/Helper/DBDB.pm +++ b/lib/Travelynx/Helper/DBDB.pm @@ -30,7 +30,7 @@ sub has_wagonorder_p { my ( $self, $ts, $train_no ) = @_; my $api_ts = $ts->strftime('%Y%m%d%H%M'); my $url - = "https://lib.finalrewind.org/dbdb/has_wagonorder/${train_no}/${api_ts}"; + = "https://www.apps-bahn.de/wr/wagenreihung/1.0/${train_no}/${api_ts}"; my $cache = $self->{cache}; my $promise = Mojo::Promise->new; @@ -43,14 +43,13 @@ sub has_wagonorder_p { } } - $self->{user_agent}->request_timeout(5)->get_p( $url => $self->{header} ) + $self->{user_agent}->request_timeout(5)->head_p( $url => $self->{header} ) ->then( sub { my ($tx) = @_; if ( $tx->result->is_success ) { - my $body = $tx->result->body; - $cache->set( $url, $body ); - $promise->resolve($body); + $cache->set( $url, 'a' ); + $promise->resolve('a'); } else { $cache->set( $url, 'n' ); |