YYW'S BLOG

知识的分享就是知识的获得
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2011年6月20日

摘要: 一个删除旧文件的函数,通常用于删除较老的log文件。moduleFileUtils2ONE_DAY_SECONDS=60*60*24#removetheoldfiles,returnthenumberoffilesthatremoved.defremove_old_files(dir_path,days_ago)count=0dir_path2=dir_path+File::ALT_SEPARATORunlessdir_path.end_with?(File::ALT_SEPARATOR)d=Dir.newdir_path2now=Time.nowd.each{|filename|nextif 阅读全文

posted @ 2011-06-20 17:03 阿武 阅读(427) 评论(0) 推荐(0) 编辑

摘要: 京东抢购页面:http://qiang.360buy.com/LimitBuy.htm有效时间:2011.6.1 - 2011.6.30开发语言:Ruby运行环境:Ruby 1.9.2 (需要安装watir)文件名:qiang.rb运行命令:ruby qiang.rb说明:可以自动抢购商品,并自动进入购物车结算,结算过程可能会遇到需要验证码情况,结算将会失败,需要手动干预。require'logger'require'watir'STDOUT.sync=truelog=Logger.new(STDOUT)log.level=Logger::DEBUG$host= 阅读全文

posted @ 2011-06-20 14:40 阿武 阅读(1050) 评论(0) 推荐(0) 编辑