Sha256: 870e4f041666d448e02b39bb762dc27d7b8c4a1af20ee5d0b51d78f7e1d82615

Contents?: true

Size: 526 Bytes

Versions: 1

Compression:

Stored size: 526 Bytes

Contents

require "notams/version"
require 'nokogiri'
require 'open-uri'


class String
  def notams
    Notams.notams(self)
  end
end

module Notams
  def self.notams(icao)
    notams = []
    get_raw_page(icao).css("pre").each {|n| notams << n.text }
    return notams
  end

private

  def self.get_raw_page(icao)
    Nokogiri::HTML(open("https://pilotweb.nas.faa.gov/PilotWeb/notamRetrievalByICAOAction.do?method=displayByICAOs&reportType=RAW&formatType=DOMESTIC&retrieveLocId=#{icao}&actionType=notamRetrievalByICAOs"))
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
notams-0.0.1 lib/notams.rb