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