This is wrapper code to emulate the http://www.qrz.com/ XML database lookup feature using a HTML scraping interface.
This program uses the qrmbot qrz scraping script. The script uses your login credentials to authenticate to qrz.com and scrape HTML output, which requires a regular (free) account, but no XML subscription.
This emulator works by using a local http server, and intercepting calls to
xmldata.qrz.com
by modifying the /etc/hosts
file.
- fldigi 4.1.03 (linux)
As tested on Debian.
apache2
perl
perl-base
perl-modules
libswitch-perl
liburi-perl
libdate-manip-perl
mkdir -p $HOME/src; cd $HOME/src
git clone https://github.com/molo1134/qrmbot.git
git clone https://github.com/cruvolo/qrzxmlemu.git
cd qrzxmlemu
echo '$login_callsign="<YOURCALL>";' > .qrzlogin
echo '$login_password="<YOURPASS>";' >> .qrzlogin
chmod 600 .qrzlogin
chown www-data.www-data .qrzlogin
Copy the example configuration to /etc/apache2/sites-available/
, then edit
it there (use an appropriate choice in naming this configuration file):
sudo cp apachesiteconfig.example.conf /etc/apache2/sites-available/002-qrzxml.conf
sudo vi /etc/apache2/sites-available/002-qrzxml.conf
On lines 12, 13 and 31 change the path for the qrzxmlemu
git checkout
directory to match your checkout path.
Then, enable the configuration and reload apache:
cd /etc/apache2/sites-enabled/; sudo ln -s ../sites-available/002-qrzxml.conf
- Reload the apache configuration:
sudo /etc/init.d/apache2 reload
sudo bash -c '( echo "127.0.0.1 xmldata.qrz.com" >> /etc/hosts )'
$ grep xmldata /etc/hosts
127.0.0.1 xmldata.qrz.com
$ curl 'http://xmldata.qrz.com/xml/current/?s=21529326d6f39f02df51826ec8989b73;callsign=AA7BQ'
<?xml version="1.0" ?>
<QRZDatabase version="1.34">
<Callsign>
<call>AA7BQ</call>
<aliases>AA7BQ/QRP,AA7BQ/R,AA7BQ/M,N6UFT,AA7BQ/DL1,AA7BQ/HR6</aliases>
<dxcc>291</dxcc>
All original code is 2-clause BSD licensed. See LICENSE file.
This was tested with the v1.34 interface.