Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Travel-Routing-DE-EFA
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
derf
Travel-Routing-DE-EFA
Commits
c7f28c4a
Commit
c7f28c4a
authored
14 years ago
by
Birte Kristina Friesel
Browse files
Options
Downloads
Patches
Plain Diff
Some documentation
parent
829d1e13
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/WWW/Efa.pm
+88
-4
88 additions, 4 deletions
lib/WWW/Efa.pm
with
88 additions
and
4 deletions
lib/WWW/Efa.pm
+
88
−
4
View file @
c7f28c4a
...
...
@@ -319,6 +319,78 @@ sub parse_pretty {
return
(
$elements
);
}
=head1 METHODS
=head2 new(%conf)
Returns a new WWW::Efa object and sets up its POST data via %conf.
Valid hash keys and their values are:
=over
=item B<from> => B<[> I<city>B<,> I<stop> [ B<,> I<type> ] B<]>
Mandatory. Sets the origin, which is the start of the journey.
I<type> is optional and may be one of B<stop> (default), B<address> (street
and house number) or B<poi> ("point of interest").
=item B<to> => B<[> I<city>B<,> I<stop> [ B<,> I<type> ] B<]>
Mandatory. Sets the destination, see B<from>.
=item B<via> => B<[> I<city>B<,> I<stop> [ B<,> I<type> ] B<]>
Optional. Specifies a intermediate stop which the resulting itinerary must
contain. See B<from> for arguments.
=item B<arrive> => I<HH:MM>
Sets the journey end time
=item B<depart>|B<time> => I<HH:MM>
Sets the journey start time
=item B<date> => I<DD.MM.>[I<YYYY>]
Set journey date, in case it is not today
=item B<exclude> => \@exclude
Do not use certain transport types for itinerary. Acceptep arguments:
zug, s-bahn, u-bahn, stadtbahn, tram, stadtbus, regionalbus, schnellbus,
seilbahn, schiff, ast, sonstige
=item B<max_interchanges> => I<num>
Set maximum number of interchanges
=item B<prefer> => B<speed>|B<nowait>|B<nowalk>
Prefer either fast connections (default), connections with low wait time or
connections with little distance to walk
=item B<proximity> => I<int>
Try using near stops instead of the given start/stop one if I<int> is true.
=item B<include> => B<local>|B<ic>|B<ice>
Include only local trains into itinarery (default), or all but ICEs, or all.
=item B<walk_speed> => B<slow>|B<fast>|B<normal>
Set walk speed. Default: B<normal>
=item B<bike> => I<int>
If true: Prefer connections allowing to take a bike along
=back
=cut
sub
new
{
my
(
$obj
,
%conf
)
=
@_
;
my
$ref
=
{};
...
...
@@ -335,16 +407,22 @@ sub new {
return
bless
(
$ref
,
$obj
);
}
=head2 $efa->submit(%opts)
Submit the query to B<http://efa.vrr.de>.
B<%opts> is passed on to WWW::Mechanize->new(%opts).
=cut
sub
submit
{
my
(
$self
,
%conf
)
=
@_
;
$conf
{'
autocheck
'}
=
1
;
my
$firsturl
=
'
http://efa.vrr.de/vrr/XSLT_TRIP_REQUEST2?language=de&itdLPxx_transpCompany=vrr
';
$self
->
{'
mech
'}
=
WWW::
Mechanize
->
new
(
autocheck
=>
1
,
timeout
=>
$conf
{'
timeout
'}
//
10
,
);
$self
->
{'
mech
'}
=
WWW::
Mechanize
->
new
(
%conf
);
$self
->
{'
mech
'}
->
get
(
$firsturl
);
$self
->
{'
mech
'}
->
submit_form
(
...
...
@@ -362,6 +440,12 @@ sub submit {
);
}
=head2 $efa->parse()
Parse the B<efa.vrr.de> reply
=cut
sub
parse
{
my
(
$self
)
=
@_
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment