X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fshow%2Fsun.pl;fp=cmd%2Fshow%2Fsun.pl;h=5104e2276035d73d0b13a0f452aee701d89a7b09;hb=0e84728de35d2dadbb9d624614a471b68ae9eef6;hp=0000000000000000000000000000000000000000;hpb=d7338541ed3f380b0d10e0676bb5d64e6e5e4d7a;p=spider.git diff --git a/cmd/show/sun.pl b/cmd/show/sun.pl new file mode 100644 index 00000000..5104e227 --- /dev/null +++ b/cmd/show/sun.pl @@ -0,0 +1,35 @@ +#!/usr/bin/perl +# +# show sunrise and sunset times for each callsign or prefix entered +# +# 1999/11/9 Steve Franke K9AN +# + +my ($self, $line) = @_; +my @list = split /\s+/, $line; + +my $l; +my @out; +my ($lat, $lon); # lats and longs in radians +my ($sec, $min, $hr, $day, $month, $yr) = (gmtime($main::systime))[0,1,2,3,4,5]; +$month++; +$yr += 1900; + +foreach $l (@list) { + # prefixes ---> + my @ans = Prefix::extract($l); + next if !@ans; + my $pre = shift @ans; + my $a; + foreach $a (@ans) { + $lat = $a->{lat}; + $lon = $a->{long}; + $lat *= $d2r; + $lon *= -$d2r; + my $string=Sun::riseset($yr,$month,$day,$lat,$lon); + push @out,sprintf("%-2s %s %s",$pre,$a->name(),$string); + $l=""; + } +} + +return (1, @out);