With everyone's help:
my Str $WebSite =
"https://www.eset.com/us/business/endpoint-security/windows-security/download/";
# need that trailing backslash
my Str $WebSite2 = "";
my Str $RevSite = "";
my Str $WebPage = "";
my $PageStatus;
my Str $ReturnStr;
my Str $CurlStatus;
if $Debug { $WebSite2 = "-v $WebSite"; } else {$WebSite2 = $WebSite; }
( $WebPage, $PageStatus ) = CurlGetWebSite( $WebSite2 );
# PrintGreenErr( "webpage status = $PageStatus\nWebpage
=<$WebPage>\n" );
if $PageStatus ne 0 || $PageStatus.contains( "301 Moved
Permanently" ) {
if $Debug { PrintBlueErr( "$SubName\: unable to download New Rev
page\:\n $WebPage\n" ); }
PrintRedErr( "$SubName\: error: \$NewRev Revision download page
failed. Bummer ...\n" );
if $PageStatus.contains( "301 Moved Permanently" ) {
PrintRedErr( " 301 Moved Permanently\n" ); }
$RevSite = "";
$NewRev = "0";
$Status +|= %StatusHash<DOWNLOAD_FAIL>;
} else {
# if the web page download okay, extact the latest new revison
from it
# <div
data-value="https://www.eset.com/us/business/endpoint-security/windows-securiy/download/?type=13554&tx_esetdownloads_ajax..."
id="apiUrl"></div>
$RevSite = $WebPage;
$RevSite ~~ s| .*?
'https://www.eset.com/us/business/endpoint-security/windows-security/download/?type=13554'
|https://www.eset.com/us/business/endpoint-security/windows-security/download/?type=13554|;
$RevSite ~~ s| '"' .* ||;
# PrintBlue( "$RevSite = <$RevSite>\n" );
( $WebPage, $PageStatus ) = CurlGetWebSite( $RevSite );
if ( $PageStatus ne 0 ) {
if $Debug { PrintBlueErr( "$SubName\: unable to download New
Rev page\:\n $RevSite\n" ); }
PrintRedErr( "$SubName\: error: \$RevSite Revision download
page failed. Bummer ...\n" );
if $PageStatus.contains( "301 Moved Permanently" ) {
PrintRedErr( " 301 Moved Permanently\n" ); }
$NewRev = "0";
$Status +|= %StatusHash<DOWNLOAD_FAIL>;
} else {
# {"family_name":"ESET Endpoint
Security","version":7,"changelogs":{"38":"<h3>Version 7.3.2039.0<\/h3>
$NewRev = $WebPage;
$NewRev ~~ s| .*? "Version " ||;
$NewRev ~~ s| '<' .* ||;
# PrintBlue( "NewRev = <$NewRev>\n" );
}
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx