Giter VIP home page Giter VIP logo

qrz_ex's Introduction

QRZ

hex.pm Hex Docs hex.pm hex.pm

QRZ.com elixir client for amateur radio callsign and DXCC lookups through their XML Data Service.

Queries require a QRZ account with an active XML Logbook Data Subscription.

Installation

The package can be installed by adding qrz to your list of dependencies in mix.exs:

def deps do
  [
    {:qrz, "~> 0.1.3"}
  ]
end

Usage

See the QRZ module documentation for additional details.

Login

Login to get session key to use for lookups. Queries that result in session expiration will return an error tuple denoting it, requiring a login call to get a new session key.

{:ok, session} = QRZ.login("username", "password")
#=> 
# {:ok,
#   %QRZ.Session{
#     key: "d0cf9d7b3b937ed5f5de28ddf5a0122d",
#     count: "6124",
#     sub_exp: "Sat Mar  8 00:00:00 2025",
#     gmt_time: "Wed Oct 18 17:09:55 2023",
#     message: "",
#     error: ""
#   }}

session.key
#=> "d0cf9d7b3b937ed5f5de28ddf5a0122d"

Callsign Lookup

Lookup callsign information.

Note: Currently every field is returned as a string, future versions may eventually cast numerical and date related values.

{:ok, callsign} = QRZ.callsign(session.key, "aa7bq")
#=> 
# {:ok,
#   %QRZ.Callsign{
#     call: "AA7BQ",
#     xref: "",
#     aliases: "N6UFT,AA7BQ/DL1,KJ6RK,AA7BQ/HR6",
#     dxcc: "291",
#     first_name: "FRED L",
#     last_name: "LLOYD",
#     ...
#   }}

callsign.call
#=> "AA7BQ"

callsign.email
#=> "[email protected]"

DXCC Lookup

Lookup DXCC entity information by entity code or callsign

{:ok, dxcc} = QRZ.dxcc(session.key, "291")
#=> 
# {:ok,
#   %QRZ.DXCC{
#     dxcc: "291",
#     cc: "US",
#     ccc: "USA",
#     name: "United States",
#     continent: "NA",
#     itu_zone: "0",
#     cq_zone: "0",
#     timezone: "-5",
#     lat: "37.701207",
#     lon: "-97.316895",
#     notes: ""
#   }}

dxcc.lat
#=> "37.701207"

dxcc.timezone
#=> "-5"

qrz_ex's People

Contributors

brycejohnston avatar

Stargazers

 avatar Andy Holman avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.