Class: Balance::Providers::Yota

Inherits:
Object
  • Object
show all
Defined in:
lib/balance/providers/yota.rb

Instance Method Summary collapse

Instance Method Details

#check(login, password) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/balance/providers/yota.rb', line 5

def check( , password )
  agent = Mechanize.new

   = agent.get 'https://my.yota.ru/selfcare/login'
   = .forms[1]
  .field(:name => 'IDToken1').value = 
  .field(:name => 'IDToken2').value = password
  .field(:name => 'IDToken3').value = password

  .submit.parser.css('.account-money dd')[0].text.match(/\d+\.\d+/)[0].to_f
end