Skip to content

Commit 0c84685

Browse files
author
tuntun
committed
刷微信运动步数(python3版)
1 parent 5cec24b commit 0c84685

1 file changed

Lines changed: 117 additions & 0 deletions

File tree

wechat-ledongli.py

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
#coding: utf-8
2+
3+
#date: 刷微信步数
4+
5+
#usage: edit steps and ledongli's uid(u need to download this app) .That would be ok .Good luck. ^_^
6+
7+
import requests
8+
9+
import sys
10+
11+
import json
12+
13+
import datetime
14+
15+
import time
16+
17+
def isnum(value):
18+
19+
try:
20+
21+
temp = int(value)
22+
23+
except Exception as e:
24+
25+
return False
26+
27+
else:
28+
29+
return True
30+
31+
# like 2015-09-25 00:00:00 converts to unix time stamp
32+
33+
def formatDate():
34+
35+
nowtime = datetime.datetime.now()
36+
37+
date = time.strftime('%Y-%m-%d')
38+
39+
strtemp_date = date + ' 00:00:00'
40+
41+
ledongli_date = time.strptime(strtemp_date, '%Y-%m-%d %H:%M:%S')
42+
43+
finaldate = time.mktime(ledongli_date) # rusult is 1443456000.0(float type), but still need to format to 1443456000
44+
45+
finaldate = int(finaldate)
46+
47+
return finaldate
48+
49+
def main(steps, uid):
50+
51+
if not isnum(steps):
52+
53+
print('param error. steps must be an integer.')
54+
55+
url = 'http://pl.api.ledongli.cn/xq/io.ashx'
56+
57+
fake_headers = {
58+
59+
'User-Agent' : 'le dong li/5.4 (iPhone; iOS 9.1; Scale/2.00)',
60+
61+
'Content-Type' : 'application/x-www-form-urlencoded; charset=UTF-8',
62+
63+
'Accept-Encoding': 'gzip'
64+
65+
}
66+
67+
keycontentjson = [
68+
69+
{
70+
71+
"date": formatDate(),
72+
"calories": 0,
73+
"activeValue": 108,
74+
"steps": steps,
75+
"pm2d5": 0,
76+
"duration": 0,
77+
"distance": 0,
78+
"report": "[]"
79+
80+
}
81+
82+
]
83+
84+
# key is a str type
85+
86+
# key must be a json data convert to string
87+
88+
key = json.dumps(keycontentjson)
89+
90+
param = {
91+
92+
'action': 'profile',
93+
94+
'pc': '29e39ed274ea8e7a50f8a83abf1239faca843022',
95+
96+
'cmd': 'updatedaily',
97+
98+
'uid': uid,
99+
100+
'list': key,
101+
'v' : '5.4%20ios',
102+
'vc' : '540%20ios'
103+
}
104+
105+
r = requests.post(url, data = param, headers = fake_headers)
106+
107+
print(r.text)
108+
109+
print('装逼成功')
110+
111+
if __name__ == '__main__':
112+
113+
steps = 199999
114+
115+
uid = '39176049'
116+
117+
main(steps, uid)

0 commit comments

Comments
 (0)