forked from 24F5/sport
增加了经纬度随机偏移和空openid检测
This commit is contained in:
parent
d7960bd040
commit
4b9ce98ae0
7
main.py
7
main.py
@ -3,6 +3,7 @@ from time import sleep
|
||||
import requests
|
||||
import json
|
||||
from datetime import datetime
|
||||
import random
|
||||
|
||||
headers = {
|
||||
'Accept-Encoding': 'gzip,compress,br,deflate',
|
||||
@ -70,7 +71,7 @@ def end(record_no):
|
||||
|
||||
def main():
|
||||
points = get_point_from_file()
|
||||
openid = ""
|
||||
openid = "" or exec('raise ValueError("请填入微信小程序openid")')
|
||||
login(openid)
|
||||
get_user()
|
||||
record_no = start()
|
||||
@ -81,8 +82,8 @@ def main():
|
||||
pointlist = []
|
||||
for i in range(start_index, min(start_index+8, len(points)),1):
|
||||
point = {"sportRecordNo": record_no,
|
||||
"longitude": points[i]["longitude"],
|
||||
"latitude": points[i]["latitude"],
|
||||
"longitude": points[i]["longitude"][:11]+str(random.randint(0,99999999)),
|
||||
"latitude": points[i]["latitude"][:10]+str(random.randint(0,99999999)),
|
||||
"placeName": (points[i]["remark"].split("_"))[0],
|
||||
"placeCode": (points[i]["remark"].split("_"))[1],
|
||||
"collectTime": datetime.now().strftime("%Y-%m-%d %H:%M:%S"),
|
||||
|
Loading…
x
Reference in New Issue
Block a user