- 论坛徽章:
- 0
|
#!/usr/bin/python
import os
import sys
import time
import locale
import httplib
def usage(prog_name):
print '''Usage: %s website username times
website: 163 or sina or poco or sinaweibo or weiboqq or weibo163''' %prog_name
def test163(username,times):
headers= {}
headers["Accept"] = "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/x-icq, application/x-silverlight, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*"
headers["Referer"] = "http://reg.163.com/login.jsp"
headers["Accept-Language"] ="zh-cn"
headers["Accept-Encoding"] = "gzip, deflate"
headers["Content-Type"]= "application/x-www-form-urlencoded"
headers["User-Agent"] = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; QQDownload 551; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; InfoPath.1)"
headers["Connection"] = "Keep-Alive"
headers["Cache-Control"] = "no-cache"
headers["Cookie"] = "URSJESSIONID=aFf5hPMy_Psc"
for i in range(0, times):
user = str(username) + " " + str(i)
data = "rl=&type=1&product=&savelogin=&outfoxer=&domains=&username=" + user + "@163.com&password=" + user + "&Submit="
conn = httplib.HTTPConnection("reg.163.com")
conn.request("POST", "/logins.jsp", data, headers)
r = conn.getresponse()
print r.read()
conn.close()
time.sleep(1)
上面的脚本是何意思,开头的headers= {}代表什么? |
|