home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2000 February
/
chip-cd_2000_02.zip
/
02
/
software
/
shareware
/
watznew
/
netaddr.lib
< prev
next >
Wrap
Text File
|
1999-10-01
|
2KB
|
61 lines
# -----------------------------------------------------------
# NET@DDRESS ROUTINES LIBRARY by A.I.Studio / Igor Afanasyev
# -----------------------------------------------------------
require 'http.lib'; # WatzNew http routines library
# -----------------------------------------------------------
sub CheckNetAddressAccount {
# -----------------------------------------------------------
($Login,$Password) = @_;
$c = &HttpPost('www.netaddress.com',80,'/tpl/Door/LoginPost',"LoginState=2&SuccessfulLogin=/tpl&NewServerName=www.netaddress.com&JavaScript=None&DomainID=4&NA31site=classic.netaddress.com&NA31port=80&UserID=$Login&passwd=$Password&Expire_Cache=&Use_Cookie=\n");
$Location = 1;
while (($c == 200) && $Location) {
$Location = undef;
($HttpBody =~ m/<META HTTP-EQUIV="Refresh" CONTENT="0;URL=(.*?)">/sgi) && ($Location = $1);
($Location =~ m/Terminated\?Reason=(.*)/sgi) && (die "ERR: Login Terminated ($1)\n");
#$Location =~ s/\/Welcome/\/Home/i;
$Location =~ s/\/tpl\/Door/\/tpl\/Mail/i;
$Location =~ s/\/Welcome/\/List?FolderId=-4/i;
#print "Location: $Location\n";
#die "ERR: No redirection location provided" if ($Location eq undef);
($Location ne '') && ($c = &HttpGet(&SplitUrl($Location)));
}
($c ne 200) && (die "ERR: HTTP Error: $c\n");
($HttpBody =~ m/Inbox\((\d*)( unread, )*(\d+)( total)*\)/si);
my $all = $3;
my $new = $1;
($all == 0) && ($all = 0);
($new == 0) && ($new = 0);
print "MSG: $all message(s), $new new\n";
my $MsgText = '';
($new == 0) && exit;
while ($HttpBody =~ m/MR\[i\] = new Object;.*?MR\[i\].R='(.*?)'.*?MR\[i\].A='(.*?)'.*?MR\[i\].T='(.*?)'.*?MR\[i\].S='(.*?)'/sgi) {
$new = ($1 ne '');
$from = $2;
$subj = $3;
$size = $4;
$from = &ConvertHtmlCodes($from);
$subj = &ConvertHtmlCodes($subj);
$size =~ s/[\t ]//gi;
$new && ($MsgText .= "<LI>$subj <I>(from $from, $size)</I>");
}
print "MSG: $MsgText\n";
} # end of sub
# -----------------------------------------------------------
1; # return true