"
(0..time.size-1).each{|i|
disp_w_img = "#{weather_img["晴れ"]}"
case now_weather[i].to_s
when /晴/
disp_w_img = "#{weather_img["晴れ"]}"
when /雨/
disp_w_img = "#{weather_img["雨"]}"
disp_w_img = "#{weather_img["弱雨"]}" if /弱/ =~ now_weather[i].to_s
when /雪/
disp_w_img = "#{weather_img["雪"]}"
else
disp_w_img = "#{weather_img["#{now_weather[i]}"]}"
end
#s << now_weather[i].to_s
night = false
if /(?:(\d+)時)|(?:(\d\d):\d\d:\d\d)/ =~ time[i]
hh = $1
[18,19,20,21,22,23,0,1,2,3,4,5].each{|t|
if t == hh.to_i then
night = true
end
}
end
if night and /晴/ =~ now_weather[i].to_s then
disp_w_img = "#{weather_img["晴れ夜"]}"
end
w_image = ""
if img_dir
if use_inlineimage
w_image = %Q!image(#{img_dir}/#{disp_w_img} #{now_weather[i]})!
else
w_image = %Q!
![#{now_weather[i]}](#{img_dir}/#{disp_w_img})
' : '>')
end
else
w_image = %Q!#{now_weather[i]}!
end
w_prec = precipitation[i].to_i
w_temp = temp[i]
w_wind = wind[i]
w_time = time[i]
w_humidity = humidity[i].gsub(/-+/,"") unless humidity[i].to_s.empty?
unless %r!m/s! =~ w_wind then
direction, strong = w_wind.scan(/([^\d]+)(\d)/).flatten
w_wind = "#{direction}(#{strong} m/s)"
end
unless template.empty? then
template.tosjis.each{|line|
line.gsub!(/<-w_天気画像>/,w_image)
line.gsub!(/<-w_降水量>/,w_prec.to_s)
line.gsub!(/<-w_気温>/,w_temp)
line.gsub!(/<-w_風>/,w_wind)
line.gsub!(/<-w_取得時間>/,w_time)
line.gsub!(/<-w_湿度>/,w_humidity.to_s)
s << line
}
else
s << w_image
s << "(#{w_prec} mm)"
s << " / "
s << "#{w_temp}℃"
s << " / "
unless w_humidity.to_s.empty? then
s << "#{w_humidity} %"
s << " / "
end
s << "#{w_wind}"
# s << " @ #{w_time[i].gsub(/^0時/,"24時")}"
s << " @ #{w_time}"
s << "#{@diary.tag_br}" unless i == time.size - 1
end
}
s << ""
s << '
'
s
else
""
end
}
when :AFTER_P
str.gsub!(/