今天上人人,看到朱大江同志的整蛊积分突然冒到7000多了,吓人一跳啊!于是弄到了一个工具~~哈哈

#encoding:cp936
"""
Written by i55m411
"""
from renren import *
from time import sleep,ctime

def deal(num,j):
...body=(("uid",num),("weaponId","1"))
...headers=[("User-Agent:","Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.8) Gecko/20100202 Firefox/3.5.8 GTB6"),
......... ("Accept","text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"),
......... ("Accept-Charset","ISO-8859-1,utf-8;q=0.7,*;q=0.7"),
......... ("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),
......... ("Referer","http://act.renren.com/yuren/home")]
...c.addheader(headers)
..."""
...try:
......data=unicode(c.postx("http://act.renren.com/yuren/op/doAttack",body).read(),"gb2312").encode("gb2312")
...except:
......data=unicode(c.postx("http://act.renren.com/yuren/op/doAttack",body).read(),"utf8").encode("gb2312")
..."""
...dic=eval(c.postx("http://act.renren.com/yuren/op/doAttack",body).read())
...if dic["result"]==true:
......action="attacking..."
...else:
......action="False"
...print "["+str(j)+"]",num,action

if __name__=="__main__":
...false=0
...true=1
...i=0
...nums=[]
...c=renren_crawler()
...email=raw_input("E-mail:")
...psw=raw_input("PSW:")
...c.login(email,psw)
...print "Running..."
...c.open_urlex("http://friend.renren.com/myfriendlistx.do")
...nums=findall(""""id":(d+),""",c.getWebcode())
...c.close()
...while 1:
......print "["+str(i)+"]","Running..."
......j=0
......for num in nums:
.........deal(num,j)
.........j+=1
......print "Done..."
......print ctime()
......print "Running..."
......sleep(3600)
......i+=1

默认无限循环执行攻击,每次攻击完毕后停顿3600s即1h后执行下一轮攻击。如果第一次执行速度慢,第二次执行速度快,可能导致部分用户没有被攻击。

点击下载

哟?不错哎 订阅小米的RSS Feeds 回去慢慢看^_^