#!/usr/bin/perl -w use strict; use warnings; # this script is repurposed to fit from an existing script for another pipeline. # basically, just find in the dir then generate an ordered list html fragment. # when that's done convert the ordered list to RSS with another perl script. my ($second, $minute, $hour, $dayOfMonth, $month, $yearOffset, $dayOfWeek, $dayOfYear, $daylightSavings) = gmtime(); my $year = 1900 + $yearOffset; my $outputpath = '/home/superkuh/www/blog/recent'; my $dirpath = '/home/superkuh/www/blog/'; my $day_of_year = (localtime)[7] +1; #my @daysback = qw/6 30 182 364 $day_of_year/; my @daysback = qw/6 13 31336/; for (@daysback) { recents($_); } # generate the RSS feeds too `/home/superkuh/www/blog/blogrssgen.pl`; sub recents { my $days = shift; my $displaydays = $days + 1; # why change it at this point? my $filetoopen = $outputpath . $displaydays . ".html"; # find /home/superkuh/www/blog/ -name "*.html" -not -name comments.html -not -name blog.html -not -name "blog-2019*.html" | sort | tac my $findargs = "find $dirpath -mtime -$days -name \"20*.html\" -not -name comments.html -not -name template.html -not -name recent7.html -not -name recent31337.html -not -name blog.html -not -name \"blog-2019*.html\" -not -name \"blog-2020*.html\" -not -name \"blog-2018*.html\" | sort | tac"; #my $findargs = "find $dirpath -mtime -$days -not -name comments.html -name \"*.html\""; my $filesize; my $date = getdate(); open(RECENT, "$findargs|") or die "cannot open the pipe to find, $findargs\n$!"; open(OUTPUT, ">$filetoopen") or die "cannot create $outputpath$displaydays.html\n$!"; #print OUTPUT "