#!/usr/bin/env ruby
=begin
@name = ARGV[0]
arg = ARGV[1..-1]
arg.each do |id|
p id
end
exit
=end
require 'rubygems'
require 'firewatir'
@name = '822438ba-0693-102c-8825-001a6426e8f8'
@pass = '888888'
ff = FireWatir::Firefox.new
b = ff
b.goto 'http://uzone.univs.cn/logincheck.jsp?id=27'
while true
if b.contains_text '|'
break
else
begin
b.goto 'javascript:ss_quit()'
rescue Exception => e
p e.message
end
#b.goto('http://uzone.univs.cn/logincheck.jsp?id=27')
end
end
b.text_field(:name,'gUser.loginName').set(@name)
b.text_field(:name,'gUser.password').set(@pass)
b.link(:href,'javascript:login();').click
b.goto("http://ulive.univs.cn/event/event/template/list/111/364.shtml")
=begin
require 'curb'
@voteData = '54090,56877,56635,53433,56593,56250,53081,55686,55583,53818,55306,55192'
@time = Time.now.to_i
c = Curl::Easy.new("http://ulive.univs.cn/event/index.shtml")
c.http_post(Curl::PostField.content('module', 'eventVote'),
Curl::PostField.content('action', 'baiJiaVote'),
Curl::PostField.content('limit', '1000'),
Curl::PostField.content('time', @time)
)
#c.perform
p c
=end
b.checkbox(:value,"53433").click
#b.startClicker("OK")
#b.goto("javascript:window.alert=Math.abs(1);")
#b.execute_script("window.alert=window.Math.abs;")
b.js_eval('window.disableA = function (f) { f.alert = null };')
b.goto 'javascript:(function (){ window.alert = function (){} })();'
b.link(:id,"voteButton").click
#b.close