# Meteoprog sublet file
# Created with sur-0.2
require 'net/http';

configure :meteoprog do |s|
  s.interval = s.config[:interval] || 1
  s.location    = s.config[:location] || "Lviv"
end

on :run do |s|
  deg = Net::HTTP.get_response(URI.parse("http://m.meteoprog.ua/ua/weather/#{s.location}/")).body[/temp"\>(.*)\&/,1]
  s.data = "#{s.location}: #{deg}°C"
end
