-
-
Save cutalion/3958397 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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