diff --git a/Makefile.PL b/Makefile.PL index 57df4f6..deb8eab 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -29,6 +29,7 @@ foreach my $dir(@dirs) { my $prereqs = { 'autodie' => 0, + 'constant' => 0, 'Carp' => 0, 'Database::Abstraction' => 0.04, 'DBD::SQLite' => 0, diff --git a/lib/Genealogy/ObituaryDailyTimes.pm b/lib/Genealogy/ObituaryDailyTimes.pm index 555f559..04f2ede 100644 --- a/lib/Genealogy/ObituaryDailyTimes.pm +++ b/lib/Genealogy/ObituaryDailyTimes.pm @@ -7,6 +7,12 @@ use File::Spec; use Module::Info; use Genealogy::ObituaryDailyTimes::obituaries; +use constant URLS => { + # 'M' => "https://mlarchives.rootsweb.com/listindexes/emails?listname=gen-obit&page=", + 'M' => "https://wayback.archive-it.org/20669/20231102044925/https://mlarchives.rootsweb.com/listindexes/emails?listname=gen-obit&page=", + 'F' => "https://www.freelists.org/post/obitdailytimes/Obituary-Daily-Times-", +}; + =head1 NAME Genealogy::ObituaryDailyTimes - Lookup an entry in the Obituary Daily Times @@ -128,16 +134,16 @@ sub _create_url { } if($source eq 'M') { - # return "https://mlarchives.rootsweb.com/listindexes/emails?listname=gen-obit&page=$page"; - return "https://wayback.archive-it.org/20669/20231102044925/https://mlarchives.rootsweb.com/listindexes/emails?listname=gen-obit&page=$page"; + return URLS->{'M'} . $page; } if($source eq 'F') { - return "https://www.freelists.org/post/obitdailytimes/Obituary-Daily-Times-$page"; + return URLS->{'F'} . $page; } if($source eq 'L') { - return $obit->{'newspaper'}; + my $newspaper = $obit->{'newspaper'} || Carp::croak(__PACKAGE__, ": undefined newspaper. Newspaper much be given when source type is 'L'"); + return $newspaper; } - Carp::croak(__PACKAGE__, ": Invalid source, '$source'"); + Carp::croak(__PACKAGE__, ": Invalid source, '$source'. Valid sources are 'M', 'F' and 'L'"); } # Helper routine to parse the arguments given to a function,