zoukankan      html  css  js  c++  java
  • 基于firetawir做的一个自动投票的东东~

    
    #!/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
  • 相关阅读:
    sss
    sss
    maven tomcat jstl 异常
    第1章 预备知识
    第2章 存储管理
    第8章 虚拟机字节码执行引擎
    第23章 Spring MVC初体验
    第1章 预备知识
    第5章 Java中的锁
    第13章 线程安全与锁优化
  • 原文地址:https://www.cnblogs.com/TLightSky/p/2941438.html
Copyright © 2011-2022 走看看