fix show/il3qar command
[spider.git] / cmd / show / ik3qar.pl
1 #
2 # Query the IK3QAR Database server for a callsign
3 #
4 # from an idea by Paolo,IK3QAR and Leo,IZ5FSA
5 #
6 # $Id$
7 #
8
9 sub handle
10 {
11         my ($self, $line) = @_;
12         my $op;
13         my $call = $self->call;
14         my @out;
15
16         return (1, $self->msg('e24')) unless $Internet::allow;
17         return (1, "SHOW/IK3QAR <callsign>\n  e.g. SH/IK3QAR II5I, SH/IK3QAR V51AS\n") unless $line;
18
19         my $target = $Internet::ik3qar_url;
20         my $url = "https://" . $target;
21
22         $line = uc $line;
23         dbg("IK3QAR: call = $line") if isdbg('ik3qar');
24         $op="call=$line\&node=$main::mycall\&passwd=$Internet::ik3qar_pw\&user=$call";  
25         my $path = "/manager/dxc/dxcluster.php?$op";
26         dbg("IK3QAR: url=$path") if isdbg('ik3qar');
27         Log('call', "$call: SH/IK3QAR $line");
28         
29         my $r = AsyncMsg->get($self, $url, $path, prefix=>'qar> ',
30                                                   'User-Agent' => "DxSpider;$main::version;$main::build;$^O;$main::mycall;$call");
31         if ($r) {
32                 push @out, $self->msg('m21', "show/ik3qar");
33         } else {
34                 push @out, $self->msg('e18', 'Open(IK3QAR.it)');
35         }
36  
37         return (1, @out);
38 }