#-*-Perl-*-

#Tack on the names of the subroutines to the list of functions
foreach ("ac","ao","aj","betty","bl","com","fbofw","fae","grizz",
	 "herman","js","knc","luann", "mar","meg","nancy","oth",
	 "peanuts","rm","rose","warped") {
    $hof{$_} = 7;
}

#Comiczone http://www.comiczone.com
sub comiczone {
    #get arguments (fp stands for file prefix)
    my ($time,$name,$fp) = @_;
    my %rec;
    my @ltime = localtime($time);
    my $t_day = strftime("%Y%m%d",@ltime);
    my $n_day = strftime("%Y%m%d",localtime(time - 7*24*3600));
    my $get_todays = ($t_day == $n_day) ? 1 : 0;

    $rec{'name'} = strftime("${name}-${date_fmt}.gif",@ltime);
    $rec{'base'} = "http://www.comiczone.com";
    $rec{'exprs'} = ["(/comics\/$fp\/archive\/images\/${fp}\\d+\.gif)"];
    if ($get_todays) {
	$rec{'page'} = "/comics/$fp/ab.html";
    } else {
	$rec{'page'} = strftime("/comics/$fp/archive/$fp%y%m%d.html",@ltime);
    }
    return \%rec;
}

#Alley Oop  http://www.comiczone.com/comics/alleyoop/archive
sub ao {
    return comiczone(shift(@_),"Alley_Oop","alleyoop");
}

#AndyCapp http://www.comiczone.com/comics/andycapp/archive
sub ac {
    return comiczone(shift(@_),"Andy_Capp","andycapp");
}
 
#Arlo and Janis http://www.comiczone.com/comics/arlonjanis/archive
sub aj {
    return comiczone(shift(@_),"Arlo_and_Janis","arlonjanis");
}

#Betty http://www.comiczone.com/comics/betty/archive
sub betty {
    return comiczone(shift(@_),"Betty","betty");
}

#The Born Loser http://www.comiczone.com/comics/bornloser/archive
sub bl {
    return comiczone(shift(@_),"The_Born_Loser","bornloser");
}

#Committed http://www.comiczone.com/comics/committed/archive
sub com {
    return comiczone(shift(@_),"Committed","committed");
}

#For Better or For Worser http://www.comiczone.com/comics/forbetter/archive
sub fbofw {
    return comiczone(shift(@_),"For_Better_or_For_Worse","forbetter");
}

#Frank and Ernest http://www.comiczone.com/comics/franknernest/archive
sub fae {
    return comiczone(shift(@_),"Frank_and_Ernest","franknernest");
}

#The Grizzwells http://www.comiczone.com/comics/grizzwells/archive
sub grizz {
    my $today = shift();
    my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = 
        localtime($today);
    if ($wday != 0) {
	return comiczone($today,"The_Grizzwells","grizzwells");
    } else {
	return undef;
    }
}

#Herman  http://www.comiczone.com/comics/herman/archive
sub herman {
    return comiczone(shift(@_),"Herman","herman");
}

#JumpStart  http://www.comiczone.com/comics/jumpstart/archive
sub js {
    return comiczone(shift(@_),"JumpStart","jumpstart");
}

#Kit 'n' Carlyle  http://www.comiczone.com/comics/kitncarlyle/archive
sub knc {
    my $today = shift();
    my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = 
        localtime($today);
    if ($wday != 0) {
	return comiczone($today,"Kit-n-Carlyle","kitncarlyle");
    } else {
	return undef;
    }
}

#Luann  http://www.comiczone.com/comics/luann/archive
sub luann {
    return comiczone(shift(@_),"Luann","luann");
}

#Marmaduke  http://www.comiczone.com/comics/marmaduke/archive
sub mar {
    return comiczone(shift(@_),"Marmaduke","marmaduke");
}

#Meg!  http://www.comiczone.com/comics/meg/archive
sub meg {
    return comiczone(shift(@_),"Meg!","meg");
}

#Nancy  http://www.comiczone.com/comics/nancy/archive
sub nancy {
    return comiczone(shift(@_),"Nancy","nancy");
}

#Over The Hedge  http://www.comiczone.com/comics/hedge/archive
sub oth {
    return comiczone(shift(@_),"Over_The_Hedge","hedge");
}

#Peanuts  http://www.comiczone.com/comics/peanuts/archive
sub peanuts {
    return comiczone(shift(@_),"Peanuts","peanuts");
}

#Robotman  http://www.comiczone.com/comics/robotman/archive
sub rm {
    return comiczone(shift(@_),"Robotman","robotman");
}

#Rose is Rose  http://www.comiczone.com/comics/roseisrose/archive
sub rose {
    return comiczone(shift(@_),"Rose_is_Rose","roseisrose");
}

#warped  http://www.comiczone.com/comics/warped/archive
sub warped {
    return comiczone(shift(@_),"Warped","warped");
}

1;


