[Dxspider-support] HamQTH.com
Ricardo Suarez
eleu9da at ciudad.com.ar
Fri Sep 9 20:41:15 BST 2011
Hi, Bela
Here the code for sh/hqth running in lu9da-6 DXSpider under Debian on
Seagate Dockstar
Pay attention, need to install WWW::mechanize from cpan, like my old sh/qrz
replacement
Regards
Rick LU9DA
#***********
# hqth.pl -> copy it in /spider/local_cmd/show/hqth.pl
#***********
#
# Query the HAMQTH Database server for a callsign
#
# Copyright (c) 2001 Dirk Koopman G1TLH
#
# modified on 27/8/2009 by Ricardo Suarez LU9DA to work with the HAMQTH
style
#
# need for WWW:Mechanize ! download it from CPAN
#
# working under test on lu9da-6 cluster ( lu9da.dyndns.org 9000)
#
use WWW::Mechanize;
my ($self, $line) = @_;
my @list = split /\s+/, $line; # generate a list of callsigns
my $l;
my $call = $self->call;
my @out;
my $url;
my $page;
my $count;
my $linea;
my $indx;
return (1, $self->msg('e24')) unless $Internet::allow;
return (1, "SHOW/HQTH <callsign>, e.g. SH/QRZ lu9da") unless @list;
$url = "http://www.hamqth.com/@list";
my $mechanize = WWW::Mechanize->new(autocheck => 1);
$mechanize->agent_alias('Windows Mozilla');
$mechanize->get($url);
$page = $mechanize->content;
my @tabla = split('\n', $page);
$count=8;
push @out," ";
push @out,"HAMQTH search for @list:";
push @out," ";
foreach $linea (@tabla) {
if ($linea =~ m/\"tab1\"/) {
$count--;
}
if ($count < 8) {
$count--;
if ($count < 5) {.
$linea =~ s/<td width=\"200\" style=\"padding-left:10px\">//;
$linea =~ s/<tr>//;
$linea =~ s/<\/td>//;
$linea =~ s/<\/tr>//;
$linea =~ s/ //;
push @out, $linea;
}
if ($count == 0) {
$count=8;
}
}
}
return (1, @out);
#*************
#end hqth.pl
#*************
More information about the Dxspider-support
mailing list