[Dxspider-support] tiny QRZ replacement

Ricardo Suarez eleu9da at ciudad.com.ar
Thu May 14 02:42:42 BST 2009


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
#****************** 




More information about the Dxspider-support mailing list