Skip to content

Instantly share code, notes, and snippets.

@fffonion
Created October 25, 2013 16:25
Show Gist options
  • Save fffonion/7157469 to your computer and use it in GitHub Desktop.
Save fffonion/7157469 to your computer and use it in GitHub Desktop.
领多玩礼包
#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