# $Id: 98_DBPlan.pm 80662 2018-02-23 18:53:00Z jowiemann $ ############################################################################## # # 98_DBPlan.pm (Testversion) # # Calls the URL: https://reiseauskunft.bahn.de/bin/query.exe/dox?S=departure&Z=destination&start=1&rt=1 # with the given attributes. # S=departure will be replace with "S=".AttrVal($name, "dbplan_station", undef) # Z=destination will be replace with "S=".AttrVal($name, "dbplan_destination", undef) # See also the domumentation for external calls # Internet-Reiseauskunft der Deutschen Bahn AG # Externe Aufrufparameter und Rückgabeparameter an externe Systeme ############################################################################## use strict; use warnings; use Time::HiRes qw(gettimeofday); use HttpUtils; use HTML::Entities; use LWP; use Digest::MD5 qw(md5_hex); my $note_index; sub DBPlan_Initialize($) { my ($hash) = @_; $hash->{DefFn} = 'DBPlan_Define'; $hash->{UndefFn} = 'DBPlan_Undef'; $hash->{SetFn} = 'DBPlan_Set'; $hash->{GetFn} = 'DBPlan_Get'; $hash->{AttrFn} = 'DBPlan_Attr'; $hash->{ReadFn} = 'DBPlan_Read'; $hash->{AttrList} = "dbplan_plan_url " . "dbplan_table_url " . "dbplan_station " . "dbplan_destination " . "dbplan_via_1 " . "dbplan_via_2 " . "dbplan_journey_prod:multiple-strict,Alle,ICE-Zuege,Intercity-Eurocityzuege,Interregio-Schnellzuege,Nahverkehr," . "S-Bahnen,Busse,Schiffe,U-Bahnen,Strassenbahnen,Anruf-Sammeltaxi " . "dbplan_journey_opt:multiple-strict,Direktverbindung,Direktverbindung+Schlafwagen,Direktverbindung+Liegewagen,Fahrradmitnahme " . "dbplan_tariff_class:1,2 " . "dbplan_board_type:depart,arrive " . "dbplan_time_selection:arrive,depart " . "dbplan_delayed_Journey:off,on " . "dbplan_travel_date " . "dbplan_travel_time " . "dbplan_max_Journeys:1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30 " . "dbplan_reg_train " . "dbplan_addon_options " . "dbplan-disable:0,1 " . "dbplan-remote-timeout " . "dbplan-remote-noshutdown:0,1 " . "dbplan-remote-buf:0,1 " . "dbplan-remote-loglevel:0,1,2,3,4,5 " . "dbplan-default-char " . "dbplan-table-headers " . "dbplan-station-file " . "dbplan-base-type:plan,table " . "dbplan-special-char-decode:none,utf8,latin1(default) " . "dbplan-reading-deselect:multiple-strict,plan_departure,plan_arrival,plan_connection,plan_departure_delay,plan_arrival_delay," . "plan_travel_change,plan_travel_duration,travel_note,travel_note_text,travel_note_error," . "travel_departure,travel_destination,travel_price " . $readingFnAttributes; } sub DBPlan_Define($$) { my ( $hash, $def ) = @_; my @a = split( "[ \t][ \t]*", $def ); $hash->{version} = '23.02.2018 18:23:00'; return "DBPlan_Define - too few parameters: define DBPlan [