|
getcomics.pl - My Daily Dose of ComicsSYNOPSIS
getcomics.pl # Normal case, sends Email
getcomics.pl -d 1 # Use this for debugging
getcomics.pl -d 2 # Debugging. Saves comic in *.page files
getcomics.pl -d 1 -grab # Debugging. Read comic from *.page files
DESCRIPTIONUss this program manually or in a cron job to figure out the URLs for your favorite comic and send you an Email. The program fetches the comic and tries to find the image of the comic so you don't need to look at all that extra advertising. The program reads a configuration file which defines the users to receive the Email as well as the rules for finding the comics. Output from the program is an Email sent to a list you designate. The body of the Email looks like this:
TO: tom@somecompany.com tony@somecompany.com
Subject: From the Comic Archives
Don't bother telling me if any of these URLs fail:
Dilbert:
http://www.dilbert.com/ (Unable to find comic in URL)
Calvin and Hobbes:
http://images.ucomics.com/comics/ch/1993/ch930822.gif
Doonesbury:
http://images.ucomics.com/comics/db/2004/db040822.gif
Garfield:
http://garfield.ucomics.com/garfield/gaview.cfm (Unable to fetch initial page)
Hagar the Horrible:
http://www.kingfeatures.com/features/comics/hagar/aboutMain.htm
User Friendly:
http://www.userfriendly.org/cartoons/archives/04aug/xuf007042.gif
Non-Sequitur:
http://images.ucomics.com/comics/nq/2004/nq040822.gif
OPTIONS
PARAMETERSThe program takes no parameters. CONFIG FILEThe configuration file consists of two sections. The first follows a comment line ``#User_Definitions'' and consists of a set of Email addresses to send the message to. All users get the same Email The second section follows a comment line ``#Comic_Definitions'' and defines the comics to be fetched. Each line consists of four parts, each separated by the character '|'.
Here's a sample file. Notice the comic defintions are generally very long and have been broken after the '|' characters:
#
# Send getcomics.pl Email to these addresses
#
#User_Definitions
tom@somecompany.com
tony@somecompany.com
#Comic_Definitions
#
Dilbert |
http://www.dilbert.com/|
(/comics/dilbert/archive/images/dilbert\d{13,14}.gif)|
http://www.dilbert.com/%1%
Calvin and Hobbes |
http://www.ucomics.com/calvinandhobbes/viewch.cfm|
(http://images.ucomics.com/comics/ch/..../ch.......gif)|
%1%
Doonesbury |
http://www.doonesbury.com/strip/dailydose/|
(http://images.ucomics.com/comics/db/..../db.......gif)|
%1%
Garfield |
http://www.garfield.com/comics/comics_todays.html|
var stripName\s*=\s*.(.+/\d\d\d\d)|
%1%/ga%YY%%MM%%DD%.gif
Hagar the Horrible |
http://www.kingfeatures.com/features/comics/hagar/aboutMain.htm|
(.)|
http://www.kingfeatures.com/features/comics/hagar/aboutMain.htm
User Friendly |
http://www.userfriendly.org/static/|
(cartoons/archives/\d\d.../.{9}\.gif)|
%1%
Non-Sequitur |
http://www.non-sequitur.com/|
http://images.ucomics.com/comics/(nq/\d{4}/nq\d{6}.gif)|
http://images.ucomics.com/comics/
%1%
EXITIf no fatal errors are detected, the program exits with a return code of 0. AUTHORWritten by Terry Gliedt <tpg@hps.com> in 1994-2005. This is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; See http://www.gnu.org/copyleft/gpl.html |