X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=cmd%2Fshow%2Fdb0sdx.pl;h=c99fd69316db281f37206dcb08a5bfec7eb2504d;hb=1ec21f9257e85c03626d7d1b1d805b7b8e988986;hp=2c5700448d7beb454f404650d4d2fc2edb48f64e;hpb=ed64ea9b9a101013cebeafaf76da0fc1a17722bf;p=spider.git diff --git a/cmd/show/db0sdx.pl b/cmd/show/db0sdx.pl index 2c570044..c99fd693 100644 --- a/cmd/show/db0sdx.pl +++ b/cmd/show/db0sdx.pl @@ -2,9 +2,13 @@ # Query the DB0SDX QSL server for a callsign # # Copyright (c) 2003 Dirk Koopman G1TLH +# Modified Dec 9, 2004 for new website and xml schema by David Spoelstra N9KT +# and tidied up by me (Dirk) # -# $Id$ # +# + +use Net::Telnet; my ($self, $line) = @_; my $call = $self->call; @@ -13,13 +17,17 @@ my @out; $line = uc $line; return (1, $self->msg('e24')) unless $Internet::allow; return (1, "SHOW/DB0SDX , e.g. SH/DB0SDX ea7wa") unless $line && is_callsign($line); -my $target = 'dotnet.grossmann.com'; +my $target = $Internet::db0sdx_url || 'www.qslinfo.de'; +my $path = $Internet::db0sdx_path || '/qslinfo'; +my $suffix = $Internet::db0sdx_suffix || '.asmx'; my $port = 80; my $cmdprompt = '/query->.*$/'; my($info, $t); $t = new Net::Telnet; + +dbg("db0sdx: contacting $target:$port") if isdbg('db0sdx'); $info = $t->open(Host => $target, Port => $port, Timeout => 15); @@ -28,11 +36,14 @@ if (!$info) { push @out, $self->msg('e18', 'DB0SDX Database server'); } else { + dbg("db0sdx: connected to $target:$port") if isdbg('db0sdx'); + my $s = qq( - + $line + DXSpider V$main::version B$main::build ($call\@$main::mycall) @@ -43,12 +54,12 @@ if (!$info) { dbg("db0sdx out: $s") if isdbg('db0sdx'); - $t->print("POST /qslinfo/qslinfo.asmx HTTP/1.0"); - $t->print("Host: dotnet.grossmann.com"); + $t->print("POST $path$suffix HTTP/1.0"); + $t->print("Host: $target"); $t->print("Content-Type: text/xml; charset=utf-8"); $t->print("Content-Length: $lth"); $t->print("Connection: Close"); - $t->print("SOAPAction: \"http://dotnet.grossmann.com/qslinfo/qslinfo\""); + $t->print(qq{SOAPAction: "http://$target$path"}); $t->print(""); $t->put($s);