#! C:/perl64/bin/perl
Require lwp: useragent;
My $ UA = lwp: useragent-> new;
$ UA-> timeout (10 );
$ UA-> env_proxy;
My ($ url_new, $ url_old) = @ argv;
My $ response = $ UA-> get ($ url_new );
Die $ response-> status_line unless ($ response-> is_success );
# Print $ response-> decoded_content; # Or whatever whole file
My @ contents_new = Split (/<\/tr>/, $ response-> decoded_content );
My $ eachline = UNDEF;
# $ Response-> decoded_content just one line
# So if dealing with the line, us split
Foreach $ eachline (@ contents_new ){
Chomp $ eachline;
Next unless ($ eachline = ~ /<Tr> <TD align = "Left">/); # Sometime be not so strict
If ($ eachline = ~ /Html "> (.*?) <.*? "> \ S? ([0-9] + \. [0-9]) <\/TD>
.*? > ([0-9] + \. [0-9] | n \/A) + <
.*? > ([0-9] + \. [0-9] | n \/A) + <
.*? Html "> (.*?) <
.*? "> (.*?) <\/TD>/X)
{
Printf ("%-145s \ t: %-3.1f \ t %-3.1f \ t %-3.1f \ n", $1, $2, $5, $6 );
}
}
Print "********************************* \ n ";
= Comment
# My @ contents = $ response-> decoded_content;
# Foreach my $ content (@ contents ){
# Print $ content;
#}
$ Response = $ UA-> get ($ url_old );
Die $ response-> status_line unless ($ response-> is_success );
Print $ response-> decoded_content; # Or whatever whole file
# My @ contents_new = $ response-> decoded_content;
My @ contents_old = $ response-> decoded_content;
My $ eachline1 = UNDEF;
Foreach $ eachline1 (@ contents_old ){
Print $ eachline1 ."###";
}
# Use lwp: useragent;
# $ Browser = lwp: useragent-> new;
# $ Target_url = "http://search.cpan.org ";
# $ Response = $ browser-> post ($ target_url );
# $ Htmlcontent = $ response-> content;
# Print $ htmlcontent. "\ n ";
= Cut
The email sending function is displayed in HTML.
Use Net: SMTP;
My $ SMTP = net: SMTP-> New ($ email_server );
$ SMTP-> mail ($ email_sender );
My @ receivers = Split (";", $ email_receivers );
$ SMTP-> recipient (@ receivers );
$ SMTP-> data ();
$ SMTP-> datasend ("mime-version: 1.0 \ n ");
$ SMTP-> datasend ("Content-Type: text/html; charset = US-ASCII \ n ");
$ SMTP-> datasend ("to: $ email_receivers \ n ");
$ SMTP-> datasend ("Subject: STF change \ n ");
$ SMTP-> datasend ("$ result_content \ n ");
$ SMTP-> quit;