--- comics/fetch.pl.new 2024/12/13 16:03:49 1.31 +++ comics/fetch.pl.new 2025/04/02 13:29:10 1.32 @@ -2,6 +2,11 @@ ############################################################################### # $Log: fetch.pl.new,v $ +# Revision 1.32 2025/04/02 13:29:10 nick +# Updated FBOW to use direct download which also required fixing the direct +# download function. Lastly, I removed the restriction for resizing images +# so all comics are resized to a width of 800px. +# # Revision 1.31 2024/12/13 16:03:49 nick # This adds the ability to specify a comic as a link only with a default splash image. # @@ -77,7 +82,7 @@ print("Running"); ## ## Some default values ## -my $ver = '$Id: fetch.pl.new,v 1.31 2024/12/13 16:03:49 nick Exp $'; +my $ver = '$Id: fetch.pl.new,v 1.32 2025/04/02 13:29:10 nick Exp $'; my $comicFile = "comics.conf"; my $comicConfigVer = "Unknown"; my $reportFile = "/home/httpd/html/daily/comics/status_report.json"; @@ -139,7 +144,7 @@ foreach my $comic ( sort keys %comics ) close(IMG); system( "/usr/bin/convert -resize 800 $file $file" ) - if ( $size > 800 ) + # if ( $size > 800 ) } } @@ -197,6 +202,7 @@ sub readComicConfig ($$) { $year += 1900; $mon = sprintf("%02d", ($mon + 1)); $day = sprintf("%02d", $day); + my $year_short = substr($year, -2); open FILEN, "<$comicFile"; while () { @@ -206,6 +212,7 @@ sub readComicConfig ($$) { } if ( ( $_ !~ m/^#/ ) && ( $_ =~ m/,.*,/) ){ $_ =~ s/__YEAR__/$year/g; + $_ =~ s/__YR__/$year_short/g; $_ =~ s/__MON__/$mon/g; $_ =~ s/__DAY__/$day/g; @@ -348,7 +355,7 @@ sub writeFooter { Generated on: $sysDate
Version: $ver
Config Version: $comicConfigVer
-CVS: http://demandred.dyndns.org/cgi-bin/cvsweb/comics/ +CVS: http://demandred.dyndns.org/cgi-bin/cvsweb/comics/
Valid XHTML 1.0 Transitional @@ -413,7 +420,9 @@ sub directDownload ($$) { my $cDir = $date->{'mon2'} . $date->{'year2'}; my $cDate = $date->{'day2'}; - my $cmd = "wget --no-check-certificate -q $file --referer='" . $comics->{$comic}{'url'} ."' --user-agent=\"$USER_AGENT\" -O - | /usr/bin/convert - jpeg:images/$cDir/$comic-$cDate.jpg"; + my $cmd = "wget --no-check-certificate -q $file --referer='" . $comics->{$comic}{'url'} ."' --user-agent=\"$USER_AGENT\" $comics->{$comic}{'url'} -O - | /usr/bin/convert - images/$cDir/$comic-$cDate.$comics->{$comic}{ext}"; + + print("Command: $cmd\n"); return system($cmd); }