Skip to content

Instantly share code, notes, and snippets.

@Florian95
Forked from shingara/gist:15503
Created October 8, 2008 12:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Florian95/15505 to your computer and use it in GitHub Desktop.
Save Florian95/15505 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'mechanize'
user = 'xxxx'
pass = 'xxxx'
fini = false
a = WWW::Mechanize.new
page_post = a.post("http://#{user}.labrute.fr/login", 'pass' => pass)
while fini == false
login = ''
a.get("http://#{user}.labrute.fr/arene") do |page|
begin
login = page.search("//div[@class='name']")[0].inner_text
rescue
puts "Finish for today"
fini = true
end
end
if !login == "" && login != "le super kill"
puts "Match VS #{login}"
a.get("http://#{user}.labrute.fr/vs/#{login}")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment