#!/usr/bin/perl -w

require LWP::UserAgent;

$wirefirePath = "http://www.entropy8zuper.org/wirefire";
$moviePath = "";
$moviePathlength = length $moviePath;

print "Content-type: text/html\n\n";
print "ha";

$curLevel = 666;
$msg = "folder_q/zwop.swf";

$msgLength = length $msg;
$theMovie = substr $msg, $moviePathlength, $msgLength - $moviePathlength;

#$thisUrl = "wirefire2.pl?saveData=%3Cresponse%20data%3D%22$theMovie%22%20curLevel%3D%22$curLevel%22%20%2F%3E";
#$thisUrl = "wirefire2.pl";

$thisXML = "<response data=\"$theMovie\" curLevel=\"$curLevel\" />";
$thisXML =~ s/</%3C/g;
$thisXML =~ s/"/%22/g;
$thisXML =~ s/=/%3D/g;
$thisXML =~ s/>/%3E/g;
$thisXML =~ s/ /%20/g;
$thisXML =~ s/\//%2F/g;
$thisUrl = "$wirefirePath/data/wirefire2.pl?saveData=$thisXML";

#$thisUrl = "$wirefirePath/data/wirefire2.pl?saveData=%3Cresponse%20data%3D%22$theMovie%22%20curLevel%3D%22$curLevel%22%20%2F%3E";

$ua = new LWP::UserAgent;
$request = new HTTP::Request('GET',$thisUrl);
$response = $ua->simple_request($request);

print $thisUrl;
print $request;
print "\n";
print $response;
print "ze";