• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

BUGSH A D12-Jan-20022.8 KiB6954

CHANGELOGH A D25-Aug-200318.9 KiB755481

COPYINGH A D18-Feb-200117.6 KiB341281

INSTALLH A D03-Apr-20021.1 KiB3622

READMEH A D02-Jan-20024.4 KiB8170

README.DEFSH A D24-Aug-20038.6 KiB176148

README.LOCALH A D04-Sep-20012.7 KiB5847

README.dailystrips-cleanH A D16-Feb-2002508 1310

README.dailystrips-updateH A D09-Aug-2003924 2016

TODOH A D23-Aug-20033.4 KiB9873

archive.defH A D23-Feb-2003398 2420

dailystripsH A D03-May-202236.3 KiB1,3881,076

dailystrips-cleanH A D03-May-20223.5 KiB172115

dailystrips-updateH A D03-May-20227 KiB301203

install.plH A D25-Aug-20033.1 KiB13076

strips.defH A D03-May-202282.4 KiB4,6173,979

README

1Description:
2This Perl script downloads the URL for the current comic of various strips that
3are available online, and outputs these URLs to an HTML file. This enables you
4to view all of your favorite strips at once, instead of visiting several
5different websites.
6
7One feature that sets this program apart from the rest is the ability to operate
8in 'local' mode. This mode, instead of writing the addresses to images in the
9HTML file, actually downloads the image and saves it locally. This way, you do
10not have to wait for each image to download - it's already on your hard drive.
11This is most useful when dailystrips is run from a cron script. (See file
12README.LOCAL for more information and examples)
13
14Requirements:
15dailystrips requires a reasonably current version of Perl - it was developed
16with 5.6.0. The HTTP::Request, LWP::UserAgent, and POSIX modules are needed. If
17you want to use --date, you will need Date::Time from the TimeDate package. See
18www.cpan.org if you don't have them installed already. dailystrips was
19developed on Linux but should be able to run on any *nix with that has the
20necessary Perl modules installed. Running on Win32 is also possible.
21
22For the AvantGo mode, ImageMagick is required.
23
24Installation:
25See the INSTALL file.
26
27Usage:
28'dailystrips [stripname(s)]' will print to STDOUT an HTML page with image links
29to the latest strip. These links are to the strip's webserver.
30'dailystrips --help' lists all available options. --list shows the available
31strips and groups. Strip names can specified as listed. Groups must be preceeded
32with an '@' symbol.
33
34Adding new strips:
35The strips.def file should be relatively self-explanatory. (see README.DEFS for
36detailed information). If you are adding several strips from the same site that
37share a common format, please create a class for that site. In addition, please
38try to pick a method of determining the most current URL possible (i.e. don't
39search if it's possible to predict - we don't want to get old strips if running
40early in the morning and a site hasn't updated the static page yet) Also, when
41you add a new strip, I'd appreciate it if you could email the defintion to me at
42amedico@amedico.dhs.org so I can add it to the distribution.
43
44Personal definition file:
45Users may create a file called ".dailystrips.defs" in their home directory.
46Syntax is exactly the same as the main strips.def file. Personal files will be
47processed after the main file. This means that classes set in the main file are
48available for use in users' files. Also note that any entries (classes, strips,
49and groups) in users' files with the same name as entries in the main will take
50precedence. Personal definition files can be ignored with the '--nopersonal'
51option.
52
53System-wide definitions file:
54Administrators may wish to create definitions, classes, or groups available to
55all users on a system. This may be done by creating a file /etc/dailystrips.defs
56and placing the definitions there. This file is loaded after the default
57definition file and so may be use to override provided definitions, if desired.
58The system-wide definitions file can be ignored with the --nosystem option.
59
60Definition upgrades:
61Since full releases are not made available every time the definitions file
62changes, the current CVS copy of the definitions file is available through a
63link at http://dailystrips.sourceforge.net/download.html. Users may either
64replace /usr/share/dailystrips/strips.def with this updated copy, or if a
65package management system is used (Debian dpkg, RPM, etc.) placing the updated
66definitions in /etc/dailystrips.defs is recommended.
67
68*Notice*:
69Keep in mind that this program is for personal use only, as making
70the output publicly available on the internet constitutes copyright infringement
71without permission from the strips' authors. If you're running it on a personal
72webserver that can be accessed fron the internet (even if it's not specifically
73public), make sure you set up restrictions so that only you have access to it -
74some publishers (Keenspot, Exclusive Content) seem to be checking their
75webserver logs for dailystrips users and will come after you in a rather nasty
76fashion if it even looks like you're using dailystrips to make a public website.
77
78Copyright info:
79This program Copyright (C) 2001 Andrew Medico <amedico@amedico.dhs.org>.
80All rights reserved. This program is free software; you may redistribute it
81and/or modify it under the terms of the GNU GPL, Version 2.

README.DEFS

1This file describes in further detail how the strips.def file is contsructed.
2
3Strips can be defined in one of two ways. The first is standalone. Also, strips
4can be provide the image URL by generating it (as from the current date) or by
5searching a web page for a URL. Let's look at an example of generating first:
6
7strip badtech
8	name Badtech
9	artist James Sharman
10	homepage http://www.badtech.com/
11	type generate
12	imageurl http://www.badtech.com/a/%-y/%-m/%-d.jpg
13	provides any
14end
15
16In the first line, we specify the short name of the strip that will be used to
17refer to it on the command line. This must be unique. Next, "name" specifies the
18name of the strip to display in the HTML output. "artist" specifies the strip
19artist's name, which will be displayed on the same line as the name of the
20strip. "homepage" is the address of the strip's homepage, use for the link in
21the output. "type" can be either "generate" or "search". Here we are using
22"generate" to generate a URL. "imageurl" is the address of the image. You are
23allowed to use a number of special variables. Single letters preceeded by the
24"%" symbol, such as "%Y", "%d", "%m", etc. are interpreted as date variables
25and passed to the strftime function for conversion. Date variables may be used
26in: homepage, searchpage, searchpattern, imageurl, baseurl, and referer.
27"date --help" provides a reference that is compatible. You can also use a "$"
28followed by the name of the above variables, such as "$homepage". This will
29simply subsititute "http://www.badtech.com" in place of "$homepage". You can
30use named variables for name, homepage, searchpage, searchpattern, imageurl,
31baseurl, referer variables on homepage, searchpage, searchpattern, imageurl,
32baseurl, and referer lines.
33
34
35The other type of URL generation, searching, is as follows:
36
37strip joyoftech
38	name The Joy of Tech
39	homepage http://www.joyoftech.com/joyoftech/
40	type search
41	searchpattern <IMG.+?src="(joyimages/\d+\.gif)\"
42	matchpart 1
43	baseurl http://www.joyoftech.com/joyoftech/
44	provides latest
45end
46
47"strip", "name", and "homepage" all function as above. The difference is the
48"type search" line and the lines that follow. "searchpattern" is a Perl regular
49expression that must be written to match the strip's URL. Not shown is
50"searchpage", which would ordinarily go above "searchpattern". This is a URL to
51a web page and is only needed if the URL to the strip image is not found on the
52homepage. The same special variables listed above for "imageurl" may also be
53used here. "matchpart" tells the script which parenthetical section (there must
54be at least one) will contain the desired URL (see man perlre on $n variables
55for more). Note that this line is only mandatory for values other than 1.
56"baseurl" only needs to be specified if the "searchpattern" regular expression
57does not match a full URL (that is, it does not start with "http://" and contain
58the host). If specified, it is prepended to whatever "searchpattern" matched.
59Not shown is "urlsuffix", which will be appended to the what "searchpattern"
60matched. Finally, "imageurl" can also be used here in place of "baseurl" and
61"urlsuffix". It is useful when addresses to the strip image must be constructed
62from a known portion and a variable portion that is searched for. Simply specify
63the URL template and insert "$match" wherever you wish the result of the search
64to be put. To access multiple matches, use the $match[1..9] variables. See the
65strips "8bit" and "pgs" for examples of how this works.
66
67The "provides" line indicates which type of strips the definition can provide:
68either "any" for a definition that can provide the strip for any given date
69or "latest" for a definition that can only provide the current strip. This is
70used so that the program can skip definitons that only provide the latest strip
71when running with the --date option.
72
73Two additional variables are not shown. First is "referer". Some webservers
74insist that the HTTP_REFERER header be set to the address of the HTML page that
75the image is on, or they will not return the image. This is to prevent other
76sites from linking to the image and (presumably) scripts like this from
77functioning. What the script does by default is set the HTTP_REFERER header to
78the searchpage (if specified), or the homepage (if no specific searchpage was
79specified). If the webserver for some reason needs a referer other than the
80searchpage or homepage, it can be specified with this variable. The second
81keyword is "prefetch". This was added because it seemed at one point that
82sfgate required a certain page to be downloaded immediately before the strip
83images could be loaded.  The syntax is simply "prefetch [URL]". Any URL
84specified will be downloaded immediately before the strip image. If this URL
85cannot be retrieved (error 404 from the webserver, etc), no attempt will be made
86to download the strip image.
87
88New feature: you can now put little snippets of Perl code right into the
89definition. For example, the definition for The Norm uses this to generate the
90day number for 14 days ago. The Norm website uses Javascript to generate the
91image URL, so it couldn't be searched for and previously there was no way to
92work with dates other than the current date. Here's how it works: just
93insert <code:Perl code>. No need to quote the code, just put it where
94"Perl code" is. Don't forget to escape any > that may happen to be in your
95code.
96
97
98The other method of specifying strips is to use classes. This method is used
99when there are serveral strips provided by the same webserver that all have an
100identical definition, except for some strip-specific elements. Classes work as
101follows:
102
103First, the class is declared:
104class ucomics-srch
105	homepage http://www.ucomics.com/$strip/view$1.htm
106	type search
107	searchpattern (/$1/(\d+)/$1(\d+)\.(gif|jpg))
108	matchpart 1
109	baseurl http://images.ucomics.com/comics
110	provides latest
111end
112
113This is just like a strip definition, except "class" is the first line. The
114value for "class" must be unique among other classes but will not conflict with
115the names of strips. Strip-specific elements are specified using special
116variables "$x", where "x" is a number from 0 to 9. When the definition file is
117parsed, these variables are retrieved from the strip definition, shown below.
118
119strip calvinandhobbes
120	name Calvin and Hobbes
121	useclass ucomics-srch
122	$1 ch
123end
124
125This definition is like a normal definition except the second line is "useclass"
126followed by the name of the class to use. Below that, the strip-specific "$x"
127variables must be specified. Values already declared in the class can be
128overridden (if necessary) by simply specifying them in the strip definition.
129
130
131For your convenience, "groups" of strips may also be defined. These allow you to
132use a single keyword on the command line to refer to a whole set of strips. The
133construct is as follows:
134
135>group favorites
136>	desc My Favorite Comics
137>	include peanuts
138>	include foxtrot, userfriendly
139>end
140
141The group name must be unique among all groups, but will not conflict with
142strips or classes (in fact it might be useful to have a group for each class - I
143might even make that automatic). "desc" is a description of the group that will
144be shown by --list. Everything after an "include" is added to the list of
145strips. You may specify one or more strips per "include" line, whatever you
146prefer. Groups are referenced on the command line by an "@" symbol followed by
147the name (bare words not preceeded by an "@" symbol will be considered strips).
148Finally, you may use "exclude [strips]" lines instead of "include" lines to
149make the group contain everystrip except those specified.
150
151Notes:
152
153* As of 1.0.10, only date variables use the "%" symbol - everything else now
154  uses "$"
155
156* For classes, variables declared in the strip definition take precedence over
157  those specified in the class, if there is any conflict
158
159* You cannot use "$variablename" to refer to a variable below the current line
160  (assuming that you use the standard order) if the referenced variable is a
161  reference itself - the script only parses "$variablename" references once.
162  This is a bug and is scheduled to be fixed.
163
164* If no "searchpage" is specified for definitions of type "search", the value of
165  "homepage" is used.
166
167* If no "referer" is specified, the value of "searchpage" is used. If this has
168  not been set (in the case of definitions that generate the URL or search
169  definitions that use the homepage as the searchpage), the value of "homepage"
170  is used.
171
172* There may be additional problems lurking in the defintion file-parsing code.
173  It currently works fairly well, but needs to be re-written properly.
174
175* Group, strip, and class names can contain pretty much any character except
176  semicolon, space, and pipe.

README.LOCAL

1This file describes in further detail dailystrips' 'local' mode of
2operation.
3
4Normally, dailystrips generates the URLs to the selected strips and
5displays them on STDOUT for redirection into a file (--output lets you
6specify a file to save the HTML into automatically).  However, this is
7usually inconvenient as you must first run the program  manually,  and
8then wait for your browser to download the images. Local mode, instead
9of putting the address of each image in the generated page,  downloads
10the image and save a copy of it locally. The address in  the generated
11page then refers to that downloaded image. With this,  you do not have
12to wait for your browser to download the images from the 'net  -  they
13are already on your hard drive (or your own webserver - another way to
14set it up).  The time savings really add up when you want to view  the
15page more than once.
16
17Method 1: (one system)
18
19Create a directory (such as /home/user/dailystrips/) in which to store
20the downloaded images and output files.
21
22Create a cron script like the following and put it in  /etc/cron.daily
23(call it dailystrips.sh, etc)
24
25#!/bin/sh
26echo "dailystrips running:"
27su user -c "dailystrips --basedir /home/user/dailystrips --local all"
28
29Of course, change /home/user/dailystrips to the exact  directory  that
30you created.  Also, change "su user.." to reflect an appropriate login
31(your own is  best if you created a  directory in your home directory)
32You should also change the "all"  to reflect just  the strips you want
33to see - the over 200 strips would take a rather long time to download
34even with a fast connection.
35
36By default, the program calls the output file 'dailystrips-YYYY.MM.DD'
37and creates 'index.html' as a symlink to this, so that you can make a
38bookmark to index.html  in your web browser that will always take you
39to the latest page.  If you need to change this,  you'll have to edit
40the script.
41
42For scheduling the time that dailystrips runs, you'll have to consider
43your time zone.  I have found  that running at  0600 EST (-0500) works
44well for my strips (see the contents of group 'andrew').  You may have
45to experiment a  little to find the best time for the  specific strips
46you download. One idea is to create a crontab entry to run dailystrips
47early in the morning  and then a few hours later  if the strips aren't
48all available at one time.
49
50
51Method 2: (webserver/intranet)
52
53This is the same as above  -  just locate the directory somewhere  in
54your webserver's document root.  Keep in mind that this should  be for
55personal  use only,  as making the  output publicly  available  on the
56internet constitutes  copyright infringement, without permission  from
57the strips' authors. As far as I know, though, it's within your rights
58to use this for personal use.

README.dailystrips-clean

1Description:
2In order to keep disk usage down, the dailystrips-clean script is provided to
3automatically delete files that are older than a specified number of days, for
4example, a week or a month.
5
6Usage:
7Operation is straightforward. In the directory where the downloaded strip and
8HTML files are located, simply run the command:
9
10'dailystrips-clean DAYS'
11
12Where DAYS is the number of days to preserve. There are also a few simple
13options available that may be viewed by running 'dailystrips-clean --help'.

README.dailystrips-update

1Description:
2The dailystrips-update script is provided to automatically retrieve updated
3strip definitions from a central server, eliminating the need to manually
4download and install new versions of the entire program.
5
6It is recommened that the dailystrips-update script be run before each
7execution of the main dailystrips program. The dailystrips-update script
8has provisions to only check for updates if the current file has reached a
9certain age, which maximizes efficiency and should allow users to run the
10update script before each execution of dailystrips without overtaxing the
11update server.
12
13Usage:
14Operation is straightforward. Simply execute dailystrips-update and the
15updated definitions will be saved to ~/.dailystrips-updates.def, which will
16automatically be loaded by the main dailystrips program.
17
18There are also a few simple options available that may be viewed by running
19'dailystrips-update --help'.
20