Skip to content

Instantly share code, notes, and snippets.

@GameXG
Last active October 2, 2015 06:05
Show Gist options
  • Save GameXG/a37e4276db4305e4911b to your computer and use it in GitHub Desktop.
Save GameXG/a37e4276db4305e4911b to your computer and use it in GitHub Desktop.
import re
import requests
import time
uname = 'test'
def k():
s = requests.session()
r=s.get('http://apple.cargomart.cn/index.php?m=Index&a=go&id=34081&from=groupmessage&isappinstalled=0')
a,b,fromhash =re.findall(u'(\d+)\+(\d+)=.+?<input type="hidden" name="formhash" value="(.+?)">',r.content,re.S)[0]
a=int(a)
b=int(b)
c=a+b
r=s.get('http://apple.cargomart.cn/index.php?m=Index&a=kanjia&id=tom_kanjia&mod=ajax&act=kanjia&kid=1&uid=34081&name=%s&num_sun=63&formhash=%s&openid=&num_a=%s&num_b=%s&num_count=%s'%(uname,fromhash,a,b,c))
r_dict = r.json()
if r_dict['status'] == 200:
print u'-%s'%r_dict['price']
while True:
k()
time.sleep(1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment