2020-05-15

修改微信步数

#coding: utf-8 #date: 2015年9月29日01:50:37 #usage: edit steps and ledongli’s uid(u need to download this app) .That would be ok .Good luck. _ import requests import sys import json import datetime import time import random def isnum(value): try: temp = int(value) except Exception: return False else: return True # like 2015-09-25 00:00:00 converts to unix time stamp def formatDate(): nowtime = datetime.datetime.now() date = time.strftime(’%Y-%m-%d’) strtemp_date = date + ’ 00:00:00’ ledongli_date = time.strptime(strtemp_date, ‘%Y-%m-%d %H:%M:%S’) finaldate = time.mktime(ledongli_date) # rusult is 1443456000.0(float type), but still need to format to 1443456000 finaldate = int(finaldate) return finaldate def main(steps, uid): if not isnum(steps): print( ‘param error. steps must be an integer.’) exit() url = ‘http://pl.api.ledongli.cn/xq/io.ashx’ fake_headers = { ‘User-Agent’ : ‘Dalvik/2.1.0 (Linux; U; Android 5.0.2; MI 2 MIUI/5.7.16)’, ‘Content-Type’ : ‘application/x-www-form-urlencoded; charset=UTF-8’, ‘Accept-Encoding’: ‘gzip’ } keycontentjson = [ { “date”: formatDate(), “calories”: 0, “activeValue”: 108, “steps”: steps, “pm2d5”: 0, “duration”: 0, “distance”: 0, “report”: “[]” } ] # key is a str type # key must be a json data convert to string key = json.dumps(keycontentjson) param = { ‘action’: ‘profile’, ‘pc’: ‘865863023705721’, ‘cmd’: ‘updatedaily’, ‘uid’: uid, ‘list’: key } r = requests.post(url, data = param, headers = fake_headers) return json.loads(r.text)[“status”] if name == ‘main’: print(“Powered By 真红酱\n”) uid =input(“请输入乐动力ID—>”) steps =input(“请输入步数—>”) while main(steps, uid)!=“OK”: pass print(“设置完毕:”+str(steps))此方法仅供理论参考

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值