Skip to content

Instantly share code, notes, and snippets.

@alg
Created October 26, 2012 11:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save alg/3958386 to your computer and use it in GitHub Desktop.
Save alg/3958386 to your computer and use it in GitHub Desktop.
# encoding: utf-8
def gas(name = "", acct = "")
url = "http://sevgaz.com.ua/index.php?option=com_content&view=article&id=52"
data = `curl -F "afam=#{name}" -F "peracc=#{acct}" "#{url}" 2>/dev/null`
data.scan(%r{Адрес.*?<tr><td>(.*?)</td>\s*<td>\s*<strong>(.*?)</strong>}).flatten
end
def water(name = "", acct = "")
url = "http://sevgorvodokanal.org.ua/account.php"
data = `curl -F "accnum=#{acct}" -F "surname=#{name}" -F "submit=Посмотреть" "#{url}" 2>/dev/null`
data.scan(%r{Сумма и состояние счета</td>.*?userinfo">(.*?)</td>}m).flatten
end
puts "Газ: #{gas.inspect}"
puts "Вода: #{water.inspect}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment