Skip to content

Commit

Permalink
Tweak xt/author/celestrak_datasets.t shpplemental page scraping.
Browse files Browse the repository at this point in the history
  • Loading branch information
trwyant committed Aug 20, 2024
1 parent f199543 commit 2ec99ed
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions xt/author/celestrak_datasets.t
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ foreach my $key ( keys %got ) {
%{ $_ } = ( %{ $_ }, ignore => 0 ) for values %expect;

foreach my $key ( keys %got ) {
if ( $got{$key}{name} =~ m/ \b ( pre-launch | post-deployment ) \b /smxi ) {
if ( $got{$key}{name} =~ m/ \b (
pre-launch | post-deployment | backup \s+ launch \s+ opportunity
) \b /smxi ) {
$expect{$key}{note} = "\u$1 data sets are temporary";
$expect{$key}{name} ||= $got{$key}{name};
$expect{$key}{ignore} = 1;
Expand Down Expand Up @@ -160,7 +162,10 @@ sub parse_string {
my $parent = $anchor->parent();
my @sibs = $parent->content_list();
not ref $sibs[0]
and $sibs[0] =~ m/ \b (?: pre-launch | post-deployment ) \b /smxi
and $sibs[0] =~ m/ \b (?:
pre-launch | post-deployment |
backup \s+ launch \s+ opportunity
) \b /smxi
and next;

if ( $href =~ m/ \b (?: sup- )? gp\.php \b /smx ) {
Expand All @@ -177,8 +182,12 @@ sub parse_string {
$href =~ m{ / }smx
and next;
}
my $name = $anchor->as_trimmed_text();
$name eq ''
and not ref $sibs[0]
and $name = $sibs[0];
$data{$href} = {
name => $anchor->as_trimmed_text(),
name => $name,
@extra,
};

Expand Down

0 comments on commit 2ec99ed

Please sign in to comment.