Source

cmcc / python / cmcc_logout.py

Full commit
#!/usr/bin/env python
import cookielib, urllib2,urllib
import re
import os

cj = cookielib.CookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))


f=file("sec.txt","r")
sec=f.read()
f.close()

#logout
LogOutpostData={}


for ce in sec.split("?")[1].split("&"):
	LogOutpostData[ce.split("=")[0]]=ce.split("=")[1]

LogOutpostData["logouttype"]="TYPESUBMIT"


LogOutpostData=urllib.urlencode(LogOutpostData)
print LogOutpostData

print opener.open('http://221.176.1.140/cmcc_mobile_do_logout.php',LogOutpostData).read()