Class: RHACK::Mamba

Inherits:
Service show all
Defined in:
lib/rhack/clients/examples.rb

Constant Summary collapse

URI =
{
  :people => "http://mamba.ru/?",
  :login => "http://mamba.ru/tips/?tip=Login",
  :id => "http://vk.com%s"
}
DefaultParams =

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(frame = nil) ⇒ Mamba

Returns a new instance of Mamba.



369
370
371
372
373
374
375
376
# File 'lib/rhack/clients/examples.rb', line 369

def initialize frame=nil
  super :people, frame, {:cp=>{
    "PREV_LOGIN"=>"anotheroneuser", "LOGIN"=>"anotheroneuser", "UID"=>"494809761", "LEVEL"=>"Low", "bar"=>"AShwjUz54RmYnfClOdlMYZylGUU90PUxeFkwlGixrP2ARHDs3A0EbDDxQTEksEm4LPT8FfzpfdiMME1omFz0tVhA5QjcsCgckaSQfIDxI", "s"=>"MJt2J3U9Pnk7Qvpie13lN7rrqmahTrAk", "SECRET"=>"adqH47"},
    :eval=>false, :timeout=>5, :retry=>['TimeoutError']
  }, 5
  @links = []
  @open_links = []
end

Instance Attribute Details

Returns the value of attribute links.



352
353
354
# File 'lib/rhack/clients/examples.rb', line 352

def links
  @links
end

Returns the value of attribute open_links.



352
353
354
# File 'lib/rhack/clients/examples.rb', line 352

def open_links
  @open_links
end

Instance Method Details

#loginObject



378
379
380
381
382
383
384
385
# File 'lib/rhack/clients/examples.rb', line 378

def 
  @f.run(URI[:login]) {|p|
    p.submit('.ap-t-c//form', @f, 'login'=>@@login, 'password'=>@@pass, 'level'=>nil) {
      @f.each {|s| s.cookies.replace @f[0].cookies}
    }
  }
  Curl.wait
end

#peopleObject



387
388
389
390
# File 'lib/rhack/clients/examples.rb', line 387

def people
  # TODO
  # ... or not TODO?
end