Permalink
Browse files

scripts/callsign: add class and map to output

  • Loading branch information...
kabaka committed Dec 12, 2015
1 parent 5526f89 commit 1bf90f1bc6c601499d1a176c60403e40c03995d0
Showing with 4 additions and 6 deletions.
  1. +4 −6 scripts/callsign.rb
View
@@ -34,19 +34,17 @@
end
helpers do
def lookup callsign
api_call callsign do |json|
unless json['status'] == 'VALID'
raise 'Not a valid callsign.'
end
buf = {
'Name' => json['name'],
'Latitude' => json['location']['latitude'],
'Longitude' => json['location']['longitude']
}
reply 'Name' => json['name'],
'Class' => json['current']['operClass'],
'Location' => "#{json['location']['latitude']}, #{json['location']['longitude']} (https://www.google.com/maps/place/#{URI.encode json['address'].values[0..1].join ' '}/@#{URI.encode json['location'].values[0..1].join ','},18z/)"
reply buf
end
end

0 comments on commit 1bf90f1

Please sign in to comment.