Sha256: 5a3380932bcd69ab24be3aba6dbd7ecf49efefb0bffe88aa591366c0d2190beb

Contents?: true

Size: 581 Bytes

Versions: 17

Compression:

Stored size: 581 Bytes

Contents

#encoding: utf-8

module WeatherFetcher
  class Provider::AllMetSat < MetarProvider
    # this provider is turned off because long response time
    # typical website response - 5s
    SLOW = 5.0

    def url_for_metar(metar_city)
      u = "http://pl.allmetsat.com/metar-taf/polska.php?icao=#{metar_city.upcase}"
      return u
    end

    def process(string)
      reg = /<b>METAR:<\/b>([^<]*)<br>/
      string = string.scan(reg).first.first
      string.gsub!(/\n/, ' ')
      string.gsub!(/\t/, ' ')
      string.gsub!(/\s{2,}/, ' ')
      string.strip
    end

  end

end


Version data entries

17 entries across 17 versions & 1 rubygems

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