[Dxspider-support] tiny QRZ replacement

Robert Chalmas rcbza at hb9bza.net
Fri May 15 20:47:44 BST 2009


Hi Ricardo,

Thank you very much for this nice work!

I tried your code first on my test setup which runs on Windows XP Pro with 
ActivePerl 5.8.6. I had to install the WWW-Mechanize module with ppm. The 
installed version (0.72) seems a bit old but works obviously OK for that 
purpose. Your code was put in a C:\spider\local_cmd\show\qrz.pl file.

Then I made the same test on the real HB9IAC-8 node which runs under Ubuntu 
6.06 LTS with perl 5.8.7. Similarly, I installed the libwww-mechanize-perl 
package (version 1.12) et copied the code as /spider/local_cmd/show/qrz.pl.
Here also, the code seems to run OK, but I didn't make extended tests yet.

Thanks again for making this piece of code available to us!

Vy 73's

Robert - HB9BZA


> Hi all
> 
> Today I write a tiny (brute force) replacement  for the QRZ.com access, 
> using the http response of the QRZ page.
> 
> Need for WWW::Mechanize, but seems to work, now is  under test on 
> lu9da.dyndns.org port 9000 (LU9DA-6 Cluster).
> 
> Regards
> 
> Rick LU9DA
> 
> 
> #**********************
> #* code for qrz.pl replacement
> #**********************
> 
> #
> # Query the QRZ Database server for a callsign
> #
> # from an idea by Steve Franke K9AN and information from Angel EA7WA
> #
> # Copyright (c) 2001 Dirk Koopman G1TLH
> #
> # modified on 5/13/2009 by Ricardo Suarez LU9DA to work with the new 
> QRZ.COM
> #
> # 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;
> 
> return (1, $self->msg('e24')) unless $Internet::allow;
> return (1, "SHOW/QRZ <callsign>, e.g. SH/QRZ lu9da") unless @list;
> 
> $url = "http://qrz.com/database?callsign=@list";
> 
> my $mechanize = WWW::Mechanize->new(autocheck => 1);
> 
> $mechanize->get($url);
> 
> $page = $mechanize->content;
> 
> my @tabla = split('\n', $page);
> 
> $count=7;
> 
> foreach $linea (@tabla) {
> 
> if ($linea =~ m/<td valign=\"top\" id=\"jq\">/) {
> 
>     $count--;
> 
>     }
> 
> if ($count < 7) {
> 
>     $linea =~ s/<p>//;
> 
>     $linea =~ s/<\/p>//;
> 
>     $count--;
> 
>     if ($count < 4) {
> 
>          push @out, $linea;
> 
>          }
> 
>     if ($count == 0) {
> 
>          $count=7;
> 
>          }
> 
>       }
> 
>    }
> 
> return (1, @out);
> 
> 
> #******************
> #* end of code qrz.pl
> #******************
> 
> _______________________________________________
> Dxspider-support mailing list
> Dxspider-support at dxcluster.org
> http://mailman.tobit.co.uk/mailman/listinfo/dxspider-support
> 


-- 
Robert CHALMAS, PO Box 1225, CH-1227 Carouge/GE, SWITZERLAND
email: rcbza at hb9bza.net           web: http://www.hb9bza.net
Free DX-Cluster client RXCLUS:  http://www.hb9bza.net/rxclus
Unofficial LoTW users list:       http://www.hb9bza.net/lotw



More information about the Dxspider-support mailing list