Astro-SpaceTrack

 view release on metacpan or  search on metacpan

t/data/Mock-LWP-UserAgent/resp.json  view on Meta::CPAN

{
   "https://celestrak.org/" : {
      "GET" : [
         "200",
         "OK",
         [
            "Content-Type",
            "text/html; charset=UTF-8"
         ],
         "<!DOCTYPE html>\r\n\r\n<html>\r\n\r\n<head>\r\n\r\n<title>CelesTrak</title>\r\n\r\n<link rel=\"stylesheet\" type=\"text/css\" href=\"/site.css\">\r\n\r\n</head>\r\n\r\n<body>\r\n\r\n<!-- Formerly Celestial BBS and Celestial WWW -->\r\n\r\n<...
      ]
   },
   "https://celestrak.org/NORAD/elements/stations.txt" : {
      "GET" : [
         "200",
         "OK",
         [
            "Content-Type",

t/data/Mock-LWP-UserAgent/resp.json  view on Meta::CPAN

         ],
         "25544ISS (ZARYA)\n36086POISK\n41765TIANGONG-2\n41834BANXING-2\n42706PHOENIX\n42711ALTAIR PATHFINDER\n42712SHARC\n42713ZA-AEROSAT\n42715CSUNSAT1\n42722NJUST-1\n42726NSIGHT\n42736BEEAGLESAT\n42982KESTREL EYE IIM (KE2M)\n43020ASTERIA\n43021DEL...
      ]
   },
   "https://www.fubar.org/" : {
      "GET" : [
         "403",
         "Forbidden",
         [
            "Content-Type",
            "text/html; charset=iso-8859-1"
         ],
         "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n<html><head>\n<title>403 Forbidden</title>\n</head><body>\n<h1>Forbidden</h1>\n<p>You don't have permission to access /\non this server.<br />\n</p>\n<p>Additionally, a 403 Forbidden\ner...
      ]
   },
   "https://www.space-track.org/" : {
      "GET" : [
         "200",
         "OK",
         [
            "Content-Type",
            "text/html; charset=UTF-8",
            "Set-Cookie",
            "chocolatechip=This bears no relation to any cookie set by Space Track; path=/; domain=www.space-track.org"
         ],
         ""
      ]
   },
   "https://www.space-track.org/ajaxauth/login" : {
      "POST" : [
         "200",
         "OK",

t/data/Mock-LWP-UserAgent/resp.json  view on Meta::CPAN

         ],
         "[\n   {\n      \"COMMENT\" : null,\n      \"COMMENTCODE\" : \"0\",\n      \"COUNTRY\" : \"ISS\",\n      \"DECAY\" : null,\n      \"FILE\" : \"5055\",\n      \"INTLDES\" : \"1998-067A\",\n      \"LAUNCH\" : \"1998-11-20\",\n      \"LAUNCH_NU...
      ]
   },
   "https://www.space-track.org/basicspacedata/query/class/tle/format/tle/orderby/OBJECT_NUMBER%20asc/EPOCH/2012-04-01%2000:00:00--2012-04-02%2000:00:00/OBJECT_NUMBER/25544" : {
      "GET" : [
         "200",
         "OK",
         [
            "Content-Type",
            "text/plain;charset=UTF-8",
            "Status",
            "200"
         ],
         "1 25544U First line of data\r\n2 25544 Second line of data\r\n1 25544U First line of data\r\n2 25544 Second line of data\r\n1 25544U First line of data\r\n2 25544 Second line of data\r\n1 25544U First line of data\r\n2 25544 Second line of ...
      ]
   },
   "https://www.space-track.org/basicspacedata/query/class/tle_latest/NORAD_CAT_ID/25544" : {
      "GET" : [
         "200",
         "OK",

t/data/Mock-LWP-UserAgent/resp.json  view on Meta::CPAN

         ],
         "[\n   {\n      \"COMMENT\" : \"GENERATED VIA SPACETRACK.ORG API\",\n      \"FILE\" : \"2434103\",\n      \"INTLDES\" : \"98067A\",\n      \"NORAD_CAT_ID\" : \"25544\",\n      \"OBJECT_ID\" : \"1998-067A\",\n      \"OBJECT_NAME\" : \"ISS (ZA...
      ]
   },
   "https://www.space-track.org/basicspacedata/query/class/tle_latest/format/3le/orderby/OBJECT_NUMBER%20asc/OBJECT_NUMBER/25544/ORDINAL/1" : {
      "GET" : [
         "200",
         "OK",
         [
            "Content-Type",
            "text/plain; charset=UTF-8",
            "Set-Cookie",
            "chocolatechip=This bears no relation to any cookie set by Space Track; path=/; domain=www.space-track.org",
            "Status",
            "200"
         ],
         "0 ISS (ZARYA)\r\n1 25544U First line of data\r\n2 25544 Second line of data\r\n"
      ]
   },
   "https://www.space-track.org/basicspacedata/query/class/tle_latest/format/3le/orderby/OBJECT_NUMBER%20asc/predicates/OBJECT_NAME,TLE_LINE1,TLE_LINE2/OBJECT_NUMBER/25544,39496,39512--39515,39518--39521,39525--39532,39555--39564,39566--39571/ORDINAL...
      "GET" : [
         "200",
         "OK",
         [
            "Content-Type",
            "text/plain; charset=UTF-8",
            "Set-Cookie",
            "chocolatechip=This bears no relation to any cookie set by Space Track; path=/; domain=www.space-track.org",
            "Status",
            "200"
         ],
         "ISS (ZARYA)\r\n1 25544U First line of data\r\n2 25544 Second line of data\r\nISS DEB (VSPLESK PLTFRM)\r\n1 39496U First line of data\r\n2 39496 Second line of data\r\nFLOCK 1-3\r\n1 39512U First line of data\r\n2 39512 Second line of data\r...
      ]
   },
   "https://www.space-track.org/basicspacedata/query/class/tle_latest/format/3le/orderby/OBJECT_NUMBER%20asc/predicates/OBJECT_NAME,TLE_LINE1,TLE_LINE2/OBJECT_NUMBER/25544/ORDINAL/1" : {
      "GET" : [
         "200",
         "OK",
         [
            "Content-Type",
            "text/plain; charset=UTF-8",
            "Set-Cookie",
            "chocolatechip=This bears no relation to any cookie set by Space Track; path=/; domain=www.space-track.org",
            "Status",
            "200"
         ],
         "ISS (ZARYA)\r\n1 25544U First line of data\r\n2 25544 Second line of data\r\n"
      ]
   },
   "https://www.space-track.org/basicspacedata/query/class/tle_latest/format/json/orderby/OBJECT_NUMBER%20asc/OBJECT_NUMBER/25544/ORDINAL/1" : {
      "GET" : [

t/data/Mock-LWP-UserAgent/resp.json  view on Meta::CPAN

         ],
         "[\n   {\n      \"COMMENT\" : \"GENERATED VIA SPACETRACK.ORG API\",\n      \"FILE\" : \"1681502\",\n      \"INTLDES\" : \"98067A\",\n      \"NORAD_CAT_ID\" : \"25544\",\n      \"OBJECT_ID\" : \"1998-067A\",\n      \"OBJECT_NAME\" : \"ISS (ZA...
      ]
   },
   "https://www.space-track.org/basicspacedata/query/class/tle_latest/format/tle/orderby/OBJECT_NUMBER%20asc/EPOCH/%3Enow-30/OBJECT_NAME/inmarsat~~/OBJECT_TYPE/payload/ORDINAL/1" : {
      "GET" : [
         "200",
         "OK",
         [
            "Content-Type",
            "text/plain;charset=UTF-8",
            "Status",
            "200"
         ],
         "1 20918U First line of data\r\n2 20918 Second line of data\r\n1 21149U First line of data\r\n2 21149 Second line of data\r\n1 21814U First line of data\r\n2 21814 Second line of data\r\n1 21940U First line of data\r\n2 21940 Second line of ...
      ]
   },
   "https://www.space-track.org/basicspacedata/query/class/tle_latest/format/tle/orderby/OBJECT_NUMBER%20asc/OBJECT_NUMBER/1--50/ORDINAL/1" : {
      "GET" : [
         "200",
         "OK",
         [
            "Content-Type",
            "text/plain; charset=UTF-8",
            "Set-Cookie",
            "chocolatechip=This bears no relation to any cookie set by Space Track; path=/; domain=www.space-track.org",
            "Status",
            "200"
         ],
         "1 00004U First line of data\r\n2 00004 Second line of data\r\n1 00005U First line of data\r\n2 00005 Second line of data\r\n1 00008U First line of data\r\n2 00008 Second line of data\r\n1 00009U First line of data\r\n2 00009 Second line of ...
      ]
   },
   "https://www.space-track.org/basicspacedata/query/class/tle_latest/format/tle/orderby/OBJECT_NUMBER%20asc/OBJECT_NUMBER/25544,36086,41765,41834,42706,42711--42713,42715,42722,42726,42736,42982,43020,43021,43466--43468,43546--43554,43556--43561,435...
      "GET" : [
         "200",
         "OK",
         [
            "Content-Type",
            "text/plain;charset=UTF-8",
            "Status",
            "200"
         ],
         "1 25544U First line of data\r\n2 25544 Second line of data\r\n1 36086U First line of data\r\n2 36086 Second line of data\r\n1 41765U First line of data\r\n2 41765 Second line of data\r\n1 41834U First line of data\r\n2 41834 Second line of ...
      ]
   },
   "https://www.space-track.org/basicspacedata/query/class/tle_latest/format/tle/orderby/OBJECT_NUMBER%20asc/OBJECT_NUMBER/25544--25546/ORDINAL/1" : {
      "GET" : [
         "200",
         "OK",
         [
            "Content-Type",
            "text/plain;charset=UTF-8",
            "Status",
            "200"
         ],
         "1 25544U First line of data\r\n2 25544 Second line of data\r\n1 25545U First line of data\r\n2 25545 Second line of data\r\n1 25546U First line of data\r\n2 25546 Second line of data\r\n"
      ]
   },
   "https://www.space-track.org/basicspacedata/query/class/tle_latest/format/tle/orderby/OBJECT_NUMBER%20asc/OBJECT_NUMBER/25544/ORDINAL/1" : {
      "GET" : [
         "200",
         "OK",
         [
            "Content-Type",
            "text/plain; charset=UTF-8",
            "Set-Cookie",
            "chocolatechip=This bears no relation to any cookie set by Space Track; path=/; domain=www.space-track.org",
            "Status",
            "200"
         ],
         "1 25544U First line of data\r\n2 25544 Second line of data\r\n"
      ]
   },
   "https://www.space-track.org/basicspacedata/query/class/tle_latest/format/tle/orderby/OBJECT_NUMBER%20asc/OBJECT_NUMBER/25544/ORDINAL/1--5" : {
      "GET" : [
         "200",
         "OK",
         [
            "Content-Type",
            "text/plain; charset=UTF-8",
            "Set-Cookie",
            "chocolatechip=This bears no relation to any cookie set by Space Track; path=/; domain=www.space-track.org",
            "Status",
            "200"
         ],
         "1 25544U First line of data\r\n2 25544 Second line of data\r\n1 25544U First line of data\r\n2 25544 Second line of data\r\n1 25544U First line of data\r\n2 25544 Second line of data\r\n1 25544U First line of data\r\n2 25544 Second line of ...
      ]
   },
   "https://www.space-track.org/basicspacedata/query/class/tle_latest/format/tle/orderby/OBJECT_NUMBER%20asc/OBJECT_NUMBER/34627,35691/ORDINAL/1" : {
      "GET" : [
         "200",
         "OK",
         [
            "Content-Type",
            "text/plain;charset=UTF-8",
            "Status",
            "200"
         ],
         "1 34627U First line of data\r\n2 34627 Second line of data\r\n1 35691U First line of data\r\n2 35691 Second line of data\r\n"
      ]
   },
   "https://www.space-track.org/basicspacedata/query/class/tle_latest/format/tle/orderby/OBJECT_NUMBER%20asc/OBJECT_NUMBER/38358,38359/ORDINAL/1" : {
      "GET" : [
         "200",
         "OK",
         [
            "Content-Type",
            "text/plain;charset=UTF-8",
            "Status",
            "200"
         ],
         "1 38358U First line of data\r\n2 38358 Second line of data\r\n1 38359U First line of data\r\n2 38359 Second line of data\r\n"
      ]
   },
   "https://www.space-track.org/basicspacedata/query/class/tle_latest/format/tle/orderby/OBJECT_NUMBER%20asc/OBJECT_NUMBER/51--66/ORDINAL/1" : {
      "GET" : [
         "200",
         "OK",
         [
            "Content-Type",
            "text/plain; charset=UTF-8",
            "Set-Cookie",
            "chocolatechip=This bears no relation to any cookie set by Space Track; path=/; domain=www.space-track.org",
            "Status",
            "200"
         ],
         "1 00051U First line of data\r\n2 00051 Second line of data\r\n1    52U First line of data\r\n2    52 Second line of data\r\n1 00053U First line of data\r\n2 00053 Second line of data\r\n1 00054U First line of data\r\n2 00054 Second line of ...
      ]
   }
}

tools/modeldef  view on Meta::CPAN

my %opt;

GetOptions( \%opt,
    qw{ username=s password=s },
    help => sub { pod2usage( { -verbose => 2 } ) },
) or pod2usage( { -verbose => 0 } );

my %desc;

my $cgi = CGI->new();
$cgi->charset( 'utf-8' );
my $json = JSON->new()->utf8();
my $st = Astro::SpaceTrack->new();

foreach my $attr ( qw{ password username } ) {
    defined $opt{$attr}
	and $st->set( $attr => $opt{$attr} );
}

defined $opt{username}
    or defined $opt{password}
    or $st->set( identity => 1 );

my $title = 'Space Track Model Definitions';

print
#   $cgi->header( -charset => 'utf-8' ),
    $cgi->start_html( -title => $title, -style => { src => 'trw.css' } ),
    $cgi->h1( $title ), $cgi->p( <<"EOD" );
This is an expansion on the model definitions provided by version 2 of
the Space Track interface. It is generated by
@{[ Cwd::abs_path( $0 ) ]}
EOD

foreach my $class ( qw{ boxscore launch_site satcat tle tle_latest } ) {
    my $resp = $st->spacetrack_query_v2(
	basicspacedata	=> 'modeldef',



( run in 0.240 second using v1.01-cache-2.11-cpan-4d50c553e7e )