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
  • 相关阅读:
    浮点数
    opencv笔记-GFTTDetector
    有向图与关联矩阵
    亚像素角点
    字符串格式化输出
    字符串表示与转换
    Bresenham算法
    罗德里格斯公式
    模型调参
    jave 逻辑运算 vs 位运算 + Python 逻辑运算 vs 位运算
  • 原文地址:https://www.cnblogs.com/TLightSky/p/2941438.html
Copyright © 2011-2022 走看看