Providers
Debian Linux
SDF
MinGW-W64
Verizon
Research
Search Engines
Bing
DuckDuckGo
Google
Metacrawler
SearX
Miscellaneous
Faqs and RFCs
Open Directory Project
W3Schools Online Web Tutorials
Wikipedia
Multimedia
CTIS
For the Pigs Among Us
Family Photos
My House
My Photos (1999-2002?)
My Photos (2005)
Retro Computers
Minions of Mirth
Main
Criticals
Criticals (Single Player)
Ghaqua
Maps and Points of Interest
Miscellaneous
Monster Templates
Miscellaneous
Area Codes
Bard’s Tale
Dungeons & Dragons Online
My Blog
Quote of the Day
RogueBasin
Slashdot
The Adventuer’s Guild
Weather
GitHub:eprive/Z80-MBC3
Programming
Main
Across
Biorhythm
BMP Chips
Complex Roots
Magic Square
Magic Square(js)
Matrix(js)
More DOS Programs
Roll
Strip Dups (bash)
Wacky Wood-Worker
How To
Enlightenment 0.16.7.2 Startup Patch
How to Create an OS X Iconset
My RedHat Howto
SSH to VMS (Deathrow OpenVMS Cluster)
Tools
Allowable Mortgage Interest
Dates and Mileage
Day of the Year
Fun With Time
Downloads
Educational
Utilities
myblog-src.pl
#!/usr/pkg/bin/perl -w @wday = qw{ Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday }; @mon = qw{ January February March April May June July August September October November December }; my($sec, $min, $hour, $day, $mon, $year, $wday, $yday, $isdst) = localtime; @date = ( $wday[$wday], $day, $mon[$mon], $year+1900 ); $count_file="/arpa/gm/m/mcsuper5/html/data/count_file"; $doc="myblog.pl"; $BLOGDIR="/arpa/gm/m/mcsuper5/html/data/blog"; print "Content-type: text/html\n\n"; open HEADER, "../parts/header"; foreach (<HEADER>) { s{__TITLE__}{My Blog}; s{__BCKGRND__}{/tiles/old_paper_background.jpg}; if ( ! /navpane.html.part/ ) { print $_; } else { # system "./navpane.pl" ; $file="/www/gm/m/mcsuper5/parts/navpane.html.part"; open(CFILE, $file); while(<CFILE>) { print $_; } close(CFILE); } } close HEADER; print qq|<h1>My Blog</h1>|; print qq|<center><h3><form action="/cgi-bin/myblog.pl" >Show blog for which year? |; print qq| <select name="years"> <option selected>current <option>2025 <option>2024 <option>2023 <option>2022 <option>2021 <option>2020 <option>2019 <option>2018 <option>2017 <option>2016 <option>2015 <option>2014 <option>2013 <option>2011 <option>2010 <option>all </select> <input type="submit" value="submit"> </form></h3></center>|; print qq|<div id="blog" class="blog" >|; $SELYEARS=''; $years=0; ($Arg, $SELYEARS) = split(/=/, $ENV{"QUERY_STRING"}, 2); $years=$SELYEARS; if ($SELYEARS eq "current") { $SELYEARS=$year+1900; } if ($SELYEARS<1) { $SELYEARS="all"; } if (($SELYEARS>=1) && ($SELYEARS<=99)) { $SELYEARS=$SELYEARS+2000; } if ($SELYEARS eq "all") { $years=''; } else { $years=$SELYEARS; } my @BLOGFILES = <$BLOGDIR/${years}*.blog>; foreach (@BLOGFILES) { $PATHNAME = $_; open BLOG, $PATHNAME; foreach (<BLOG>) { # s/&/&/g; # s/</</g; # s/>/>/g; print $_; } close BLOG; } print qq|</div><p><pre>|; system "/usr/pkg/games/fortune"; print qq|</pre></p><p>This blog has been viewed |; open(CFILE, $count_file); @counts=<CFILE>; close(CFILE); # Read the count file, pick the correct entry and increment it $found = 0; for $line (@counts) { chop ($line); ($page,$count)=split(/ /, $line); $page=~s/'//g; if ($page eq $doc) { $count++; $found = 1; $line = "'$page' $count"; $found_count = $count; } push (@newcount, $line); } if ($found == 1) { $count = $found_count } else { $count = 1; push (@newcount, "'$doc' 1"); } @newcount=sort(@newcount); # Updates the count file open (CFILE, ">$count_file"); flock(CFILE, 2); # lock for $line (@newcount) { print CFILE "$line\n"; } flock(CFILE, 8); # unlock close CFILE; print "$count"; print qq| times.</p>|; open FOOTER, "../parts/footer"; foreach (<FOOTER>) { s{__DATE__}{@date}; print $_; } close FOOTER;
This source has been viewed 29 times.
Thursday, 15 May 2025
Michael J. Chappell
Contact me at:
mcsuper5@freeshell.org