Astro-SpaceTrack

 view release on metacpan or  search on metacpan

xt/author/celestrak_datasets.t  view on Meta::CPAN

    delete $got{$key};
}

# diag 'Debug - got ', explain \%got;

%expect = %{ Astro::SpaceTrack->__catalog( 'celestrak_supplemental' ) };
%{ $_ } = ( %{ $_ }, ignore => 0 ) for values %expect;

foreach my $key ( keys %got ) {
    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;
    }
}

# diag 'Debug - want ', explain \%expect;

foreach my $key (sort keys %expect) {

xt/author/celestrak_datasets.t  view on Meta::CPAN

	    and $sibs[0] == $anchor
	    and next;
	ref $sibs[0]
	    and $sibs[0] = $sibs[0]->as_trimmed_text();

	# Exclude pre-launch and post-deployment data sets, which are
	# ephemeral.
	not ref $sibs[0]
	    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 ) {
	    my $uri = URI->new( $href );
	    # NOTE convenient in this case but technically incorrect as
	    # it is legal for keys to repeat.
	    my %query = $uri->query_form();
	    #         Celestrak        Celestrak Supplemental
	    $href = ( $query{GROUP} || $query{FILE} )



( run in 0.564 second using v1.01-cache-2.11-cpan-49f99fa48dc )