lib/barometer/weather_services/weather_bug.rb in barometer-0.6.7 vs lib/barometer/weather_services/weather_bug.rb in barometer-0.7.0
- old
+ new
@@ -125,11 +125,11 @@
def self._build_forecast(data, metric=true)
raise ArgumentError unless data.is_a?(Hash)
forecasts = Measurement::ResultArray.new
# go through each forecast and create an instance
if data && data["aws:forecast"]
- start_date = Date.strptime(data['date'], "%m/%d/%Y %H:%M:%S %p")
+ start_date = Date.strptime(data['date'], "%a, %d %b %Y %H:%M:%S %Z")
i = 0
data["aws:forecast"].each do |forecast|
forecast_measurement = Measurement::Result.new
icon_match = forecast['aws:image'].match(/cond(\d*)\.gif$/)
forecast_measurement.icon = icon_match[1].to_i.to_s if icon_match
@@ -238,10 +238,10 @@
:query => { :ACode => @@api_code,
:OutputType => "1", :UnitType => (metric ? '1' : '0')
}.merge(q),
:format => :plain,
:timeout => Barometer.timeout
- )
+ )
# get icon
icon_match = response.match(/cond(\d*)\.gif/)
icon = icon_match[1] if icon_match
\ No newline at end of file