File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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 )
You can’t perform that action at this time.
0 commit comments