#!/usr/bin/perl # #################################################################### # File: hs.html # # Description: providing static-html-like entry point for third party# # store requests when called as .html # # Parameters: none # # Dependency: this file must reside on the remote host. To get a # # specific hotellist as a static link # # Created: 12.03.2003 hartl based on tp.html # # Modified: # # #################################################################### use warnings; use strict; use Cwd; require LWP::UserAgent; my $url; my $request; # request to send to store my $response; # data which comes from Store my ($land,$landid,$city,$cityid,$tp); # user agent: browser request to web server # identify ourselves as tl-city-static # do not parse header, because if you do, many meta-tags will be in HTTP header!!! my $ua = LWP::UserAgent->new(agent => "tl-city-static", env_proxy => 0, parse_head => 0); my $path = $0; $path = getcwd."/".$path unless $path =~ /^\//; $path =~ s/([^a-zA-Z0-9_\.;\/\-])/sprintf("%%%x",ord($1))/eg; # make sure link has the correct structure ($land,$landid,$city,$cityid,$tp) = ($path =~ /\/([^\/]+)_(\d+)\/([^\/]+)\/(\d+)\/[^\d]+-(\d+)\.html$/); $url="https://laura-4:8442/travelstore/control/walkin/search?agentid=${tp}&city=${cityid}&locale=en_US"; $request = HTTP::Request->new('GET', $url); $request->header('Host' => "testen.tourisline.de"); # send modified request to store $response = $ua->request($request); # give everything to the client. print "Content-Type: ".$response->header('Content-Type')."\n\n".$response->content;