Skip to content

Commit

Permalink
Re-enable findagrave searches
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelhorne committed Nov 11, 2024
1 parent d607984 commit f6f2565
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 0 deletions.
3 changes: 3 additions & 0 deletions dynamic-site/cgi-bin/page.fcgi
Original file line number Diff line number Diff line change
Expand Up @@ -429,9 +429,12 @@ sub doit
lingua => $lingua,
config => $config,
};

# Display the requested page
eval {
my $page = $info->param('page');
$page =~ s/#.*$//;

$display = do {
my $class = "Ged2site::Display::$page";
eval { $class->new($args) };
Expand Down
77 changes: 77 additions & 0 deletions ged2site
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ print "Language = $language\n" if($opts{'v'});

my @modules = ();
@needfull = ();
my $grave_modules;

if($opts{'d'} || $opts{'m'} || $opts{'w'}) {
push @modules, 'File::Spec', 'XML::Hash';
Expand Down Expand Up @@ -305,6 +306,34 @@ if($opts{'m'} || $opts{'w'}) {
if($opts{'v'}) {
push @modules, 'Log::Any::Adapter';
}
if($opts{'w'} && $opts{'c'}) {
# If you have a locally written module to look up entries,
# list them in gedcom.config,
# otherwise use Genealogy::FindaGrave
my $config;

eval { $config = Config::Auto::parse() };

if($config && $config->{'grave_modules'}) {
$grave_modules = $config->{'grave_modules'};

if(ref($grave_modules)) {
foreach my $module(@{$grave_modules}) {
autoload $module;
}
} else {
autoload $grave_modules;
}
} else {
push @modules, 'FindaGrave';

$grave_modules = 'Genealogy::FindaGrave';
}

# if(!$ged->validate() && $opts{'f'}) {
# die "$ARGV[0] is not a valid gedcom file";
# }
}

# my $libdir1 = File::Spec->catfile($FindBin::Bin, File::Spec->updir(), 'lib');
# if(-d $libdir1) {
Expand Down Expand Up @@ -9001,6 +9030,54 @@ sub print_person
});
}
}
my $lastname = $surname;
if(defined($sex) && ($sex eq 'F')) {
if(my $husband = $person->husband()) {
$lastname = $husband->surname();
}
}
if($yod && $firstname && $lastname) {
my %opts = (
date_of_death => $yod,
firstname => $firstname,
lastname => $lastname,
ua => $browser,
);
if($placeofburial) {
if($placeofburial =~ /.+,\s+(\w+)$/) {
$opts{'country'} = $1;
}
} elsif($placeofdeath) {
if($placeofdeath =~ /.+,\s+(\w+)$/) {
$opts{'country'} = $1;
}
}
if($opts{'country'} && ($opts{'country'} eq 'USA')) {
$opts{'country'} = 'United States of America';
}
# foreach my $b(Genealogy::FindaGrave->new(\%opts)) {
if(defined($grave_modules)) {
if(ref($grave_modules)) {
foreach my $m(@{$grave_modules}) {
my $b = $m->new(\%opts);
while(my $url = $b->get_next_entry()) {
complain({
person => $person,
warning => "possible burial link $url"
});
}
}
} else {
my $b = $grave_modules->new(\%opts);
while(my $url = $b->get_next_entry()) {
complain({
person => $person,
warning => "possible burial link $url"
});
}
}
}
}
}
}

Expand Down

0 comments on commit f6f2565

Please sign in to comment.