Sha256: eda8c99d2741fd59636c8b0552494aec365bef529f48ac895dd23b370e035d7e

Contents?: true

Size: 466 Bytes

Versions: 21

Compression:

Stored size: 466 Bytes

Contents

#encoding: utf-8

module WeatherFetcher
  class Provider::Noaa < MetarProvider

    def url_for_metar(metar_city)
      u = "http://weather.noaa.gov/pub/data/observations/metar/stations/#{metar_city.upcase}.TXT"
      return u
    end

    def process(string)
      string.gsub!(/\d{4}\/\d{1,2}\/\d{1,2} \d{1,2}\:\d{1,2}\s*/, ' ')
      string.gsub!(/\n/, ' ')
      string.gsub!(/\t/, ' ')
      string.gsub!(/\s{2,}/, ' ')
      string.strip
    end

  end

end


Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
weather_fetcher-0.1.5 lib/weather_fetcher/providers/metar/noaa.rb
weather_fetcher-0.1.4 lib/weather_fetcher/providers/metar/noaa.rb
weather_fetcher-0.1.3 lib/weather_fetcher/providers/metar/noaa.rb
weather_fetcher-0.1.2 lib/weather_fetcher/providers/metar/noaa.rb
weather_fetcher-0.1.1 lib/weather_fetcher/providers/metar/noaa.rb
weather_fetcher-0.1.0 lib/weather_fetcher/providers/metar/noaa.rb
weather_fetcher-0.0.16 lib/weather_fetcher/providers/metar/noaa.rb
weather_fetcher-0.0.15 lib/weather_fetcher/providers/metar/noaa.rb
weather_fetcher-0.0.14 lib/weather_fetcher/providers/metar/noaa.rb
weather_fetcher-0.0.13 lib/weather_fetcher/providers/metar/noaa.rb
weather_fetcher-0.0.12 lib/weather_fetcher/providers/metar/noaa.rb
weather_fetcher-0.0.11 lib/weather_fetcher/providers/metar/noaa.rb
weather_fetcher-0.0.10 lib/weather_fetcher/providers/metar/noaa.rb
weather_fetcher-0.0.9 lib/weather_fetcher/providers/metar/noaa.rb
weather_fetcher-0.0.8 lib/weather_fetcher/providers/metar/noaa.rb
weather_fetcher-0.0.7 lib/weather_fetcher/providers/metar/noaa.rb
weather_fetcher-0.0.6 lib/weather_fetcher/providers/metar/noaa.rb
weather_fetcher-0.0.5 lib/weather_fetcher/providers/metar/noaa.rb
weather_fetcher-0.0.4 lib/weather_fetcher/providers/metar/noaa.rb
weather_fetcher-0.0.3 lib/weather_fetcher/providers/metar/noaa.rb