add_new_from_tle_file.pl   add_new_from_tle_file.pl 
#!/usr/bin/perl #!/usr/bin/perl
# This is a helper script of download_tle_find_new.sh # This is a helper script of download_tle_find_new.sh
# It accepts a TLE list, checks if the satellites in it already are listed in # It accepts a TLE list, checks if the satellites in it already are listed in
# satellites.json, and if not, outputs appropriately formatted JSON entries . # satellites.json, and if not, outputs appropriately formatted JSON entries .
# The new satellites are added to the groups passed as parameters. # The new satellites are added to the groups passed as parameters.
# SUGGESTION: Instead of striping the Celestrak status code (the char in []
# sometimes added after the name), use it to set the "non-operation" group
# instead of arbitrarily adding it to all sats from certain sources
# (see download_tle_find_new.sh)
# Key from Celestrak.com: [+] = Operational, [-] = Nonoperational,
# for others see at the bottom of http://celestrak.com/NORAD/elements/maste
r.asp
#my $groups = "\"scientific\", \"weather\", \"non-operational\""; #my $groups = "\"scientific\", \"weather\", \"non-operational\"";
map { s/^/"/; s/$/"/; } @ARGV; map { s/^/"/; s/$/"/; } @ARGV;
my $groups = join(", ", @ARGV); my $groups = join(", ", @ARGV);
my %ignore; my %ignore;
open(SAT, "<satellites.json") || die "Cannot open existing satellites.json file"; open(SAT, "<satellites.json") || die "Cannot open existing satellites.json file";
while(<SAT>) { while(<SAT>) {
chomp; chomp;
if (/^\s*\"([^"]+)":\s*$/) { if (/^\s*\"([^"]+)":\s*$/) {
 End of changes. 1 change blocks. 
0 lines changed or deleted 8 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/