Loading Changelog +4 −0 Original line number Diff line number Diff line git HEAD * Proper HTTP request error handling Travel::Status::DE::DeutscheBahn 0.01 - Mon Jun 27 2011 * Initial release Loading lib/Travel/Status/DE/DeutscheBahn.pm +11 −3 Original line number Diff line number Diff line Loading @@ -19,6 +19,8 @@ sub new { my $ua = LWP::UserAgent->new(); my $reply; if ( not $conf{station} ) { confess('You need to specify a station'); } Loading Loading @@ -52,9 +54,15 @@ sub new { } } $ref->{html} = $ua->post( 'http://reiseauskunft.bahn.de/bin/bhftafel.exe/dn?rt=1', $ref->{post} )->content(); $reply = $ua->post( 'http://reiseauskunft.bahn.de/bin/bhftafel.exe/dn?rt=1', $ref->{post} ); if ( $reply->is_error ) { my $errstr = $reply->status_line(); confess("Could not submit POST request: ${errstr}"); } $ref->{html} = $reply->content(); $ref->{tree} = XML::LibXML->load_html( string => $ref->{html}, Loading Loading
Changelog +4 −0 Original line number Diff line number Diff line git HEAD * Proper HTTP request error handling Travel::Status::DE::DeutscheBahn 0.01 - Mon Jun 27 2011 * Initial release Loading
lib/Travel/Status/DE/DeutscheBahn.pm +11 −3 Original line number Diff line number Diff line Loading @@ -19,6 +19,8 @@ sub new { my $ua = LWP::UserAgent->new(); my $reply; if ( not $conf{station} ) { confess('You need to specify a station'); } Loading Loading @@ -52,9 +54,15 @@ sub new { } } $ref->{html} = $ua->post( 'http://reiseauskunft.bahn.de/bin/bhftafel.exe/dn?rt=1', $ref->{post} )->content(); $reply = $ua->post( 'http://reiseauskunft.bahn.de/bin/bhftafel.exe/dn?rt=1', $ref->{post} ); if ( $reply->is_error ) { my $errstr = $reply->status_line(); confess("Could not submit POST request: ${errstr}"); } $ref->{html} = $reply->content(); $ref->{tree} = XML::LibXML->load_html( string => $ref->{html}, Loading