Class: Balance::Providers::MtsMoscow

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

Instance Method Summary collapse

Instance Method Details

#check(number, password) ⇒ Object



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

def check( number, password )
  agent = Mechanize.new
  agent.user_agent = 'Mozilla/5.0 (Linux; U; Android 2.2; en-us; Desire_A8181 Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1'

   = agent.get 'https://ihelper.mts.ru/SELFCAREPDA/Security.mvc/LogOn'
   = .forms.first
  .field(:name => 'username').value = number
  .field(:name => 'password').value = password

  .submit.parser.css('.main p strong strong').text.to_f
end