09.03.09 (1:04 am) [edit]
09.01.09 (12:17 am) [edit]
use Net::HTTP;
use Digest::MD5 qw(md5_hex);
use MIME::Base64;
my $login=lc("veykhman");
my $xap_adv="";
my $ru=$ENV{'REQUEST_URI'};
my $site=$ENV{'HTTP_HOST'};
if (length($ru)<=180)
{
if ($ru eq "") {$ru="/"}
my $file=encode_base64($ru,"");
$site=~s/www\.//g;
my $path_code=md5_hex($file);
my $user_pref=substr($login,0,2);
my $path=substr($path_code,0,1)."/".substr($path_code,1,2)."/";
my $domain="$login.tnx.net";
my $path="/users/$user_pref/$login/$site/$path$file.txt";
if (my $xap_s = Net::HTTP->new(Timeout => 10, Host => "$domain"))
{
$xap_s->write_request(GET => "$path");
my($code, $mess, %h) = $xap_s->read_response_headers;
if ($code eq "200")
{
$xap_s->read_entity_body($xap_adv, 1024);
}
}
}
print $xap_adv;