#-*-Perl-*-

#Add the name of the subroutines to the hash of functions
#with the number of days from today the comic is available
#For comics that aren't updated, or are updated very irregularly,
#then set it to undef (can only retreive using -T or -S & -E).
$hof{"subname"} = 0;

sub subname {
    my $time = shift;
    my @ltime = gmtime($time);
    #Always specify 0 sec, 0 min, 0 hr with mkgmtime.
    #The 4th argument is the day.
    #The 5th argument is the month number (January = 0, December = 11).
    #The 6th argument is the year (100 for 2000, 101 for 2001, etc.).
    return undef if $time < mkgmtime(0,0,0,1,0,96); #1st comic: Jan 1, 1996
    my $baseurl = "http://www.comic-site.com/cartoon";
    my $rec = {
	'title' => "Comics Name",
	'author' => "Author's Name", #optional
	'type' => 'gif',
	'main' => "$baseurl/", #optional
	'archives' => "$baseurl/archives/", #optional
	'base' => $baseurl,
	'page' => strftime("%Y%m%d.html",@ltime),
	'exprs' => ["\\/cartoons\\/(\\d+\\.gif)"],
	'size' => [$x,$y] #be sure to specify the dimensions (optional)
	};
    return $rec;
}

sub advanced {
    my $rec = {
	'back' => sub {
	    #see Comic_Module-HOWTO.html
	},
	'func' => sub {
	    #see Comic_Module-HOWTO.html
	},
	'exprs' => {
	    'comic' => ["each one makes","another url","like 'exprs'"],
	    'title' => [undef,undef,"expr to get title in next to last url"],
	    'caption' => [undef,"this gets put in webpage below comic",undef],
	    'size' => [undef,undef,
		       "you can even replace the size field if you want"],
	    'author' => ["in case the author is different per comic",
			 undef,undef],
	    'field1' => ["you can even make up your own field name",
			 undef,undef],
#	    'bad1' => ["you must provide an expression in only one item",
#		       "this is illegal",undef],
#	    'bad2' => ["you must provide the same number of items in your",
#		       "array as that of 'comic'. this is bad."]
	},
#	'post' => sub {
	    #sometime I'll add the ability to run function after the comic
	    #has been downloaded. its argument will be the rli. That way
	    #you can further manipulate the comic, like crop it given
	    #some external program or other perl module is installed.
#	}
    }
}
1;
