Created
October 25, 2013 16:25
-
-
Save fffonion/7157469 to your computer and use it in GitHub Desktop.
领多玩礼包
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#coding:utf-8 | |
import httplib2 | |
import hashlib | |
import random | |
import json | |
alphanum='0123456789abcdef' | |
verify=lambda x:hashlib.md5("J]KcRe(dxmk5cMS-%sJ]KcRe(dxmk5cMS-"%x).hexdigest() | |
mac_gen=lambda :':'.join([random.choice(alphanum)+random.choice(alphanum)*(j/j) for j in range(1,6) ]) | |
mac=mac_gen() | |
uri='mac=%sverify=%s'%(mac,verify(mac)) | |
print (uri) | |
a,b=httplib2.Http().request('http://mafama.sinaapp.com/get.php?type=&%s'%uri,headers= | |
{'Content-Type': 'application/json;charset=gbk', | |
'Connection': 'Keep-Alive', | |
'User-Agent':' Apache-HttpClient/UNAVAILABLE (java 1.4)'} | |
) | |
b=json.loads(b) | |
for e in b: | |
print ('%s:%s\n'%(e,b[e])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment