[Dxspider-support] HamQTH.com

Simone IK5YZW bianchi.s at tin.it
Sat Sep 10 07:07:32 BST 2011


Many thanks Rick for sharing this script.

I was about to writing my own. You saved me some time :)

73s
IK5YZW   Simone



-----Messaggio originale----- 
From: Bob Nielsen
Sent: Friday, September 09, 2011 11:40 PM
To: The DXSpider Support list
Subject: Re: [Dxspider-support] HamQTH.com

I thought it looked strange, but I'm not that familiar with perl.  It works 
fine now.

73, Bob

On Sep 9, 2011, at 1:40 PM, Ricardo Suarez wrote:

> Hi, Bob
>
> In the cut&paste "born" a dot after the "{" - please erase it!, the line 
> are:
>
> if ($count < 5) {
>
> and not
>
> if ($count < 5) {.
>
> My fault, sorry
>
> Regards
>
> Rick LU9DA
>
>
>
>
> ----- Original Message ----- From: "Bob Nielsen" <n7xy at clearwire.net>
> To: "The DXSpider Support list" <dxspider-support at dxcluster.org>
> Sent: Friday, September 09, 2011 8:26 PM
> Subject: Re: [Dxspider-support] HamQTH.com
>
>
>> Thanks for posting this, Rick.
>>
>> I installed libwww-mechanize-perl from Debian 6.0 and did a cut/paste 
>> installation of your code.  When I try to run it, I get the following 
>> error:
>>
>> syntax error at (eval 151693) line 65, near "{."
>>
>> 73, Bob N7XY
>>
>> On Sep 9, 2011, at 12:41 PM, Ricardo Suarez wrote:
>>
>>> 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
>>> #*************
>>>
>>> _______________________________________________
>>> Dxspider-support mailing list
>>> Dxspider-support at dxcluster.org
>>> http://mailman.tobit.co.uk/mailman/listinfo/dxspider-support
>>
>> _____
>> N7XY DX Cluster Node - telnet to n7xy.net, port 7300
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>> Dxspider-support mailing list
>> Dxspider-support at dxcluster.org
>> http://mailman.tobit.co.uk/mailman/listinfo/dxspider-support
>
>
> _______________________________________________
> Dxspider-support mailing list
> Dxspider-support at dxcluster.org
> http://mailman.tobit.co.uk/mailman/listinfo/dxspider-support

_____
N7XY DX Cluster Node - telnet to n7xy.net, port 7300






_______________________________________________
Dxspider-support mailing list
Dxspider-support at dxcluster.org
http://mailman.tobit.co.uk/mailman/listinfo/dxspider-support 




More information about the Dxspider-support mailing list