Commit be631557 by BellCodeEditor

auto save

parent a0cbfb52
Showing with 76 additions and 2 deletions
import requests
import json
import time
import datetime
def start():
#缓存文件的userId
userId = "11999093"
#缓存文件的token
token = "D2A6AFB93531605DBE56DC2EEE74C4C986D26E1E27076265463DF496B92A71870719B6A5F27120C115AE0E668FE3A8C10699F11A20A4EB6EA283A6A7945D52713AFD189A0A2E8E2B758CF2255EE337349B174AE6AAC6FA2A5387C39A58E1DCA6.E622D1D9BB17EB1746B0DAA1B2B039DF385091A4441D6D99461FF2597C211498"
#缓存文件的ck
ck = "session=%7B%22accessToken%22%3A%22891c76d4e4954716a355a04a356e00ca%22%2C%22appType%22%3A6%2C%22expireAt%22%3A1599923244863%2C%22loginId%22%3A%2211999093%22%2C%22userType%22%3A99%2C%22gray%22%3Afalse%7D; accessToken2=891c76d4e4954716a355a04a356e00ca; appType2=6; expireAt2=1599923244863; loginId2=11999093; userType2=99; gray2=false; accessToken=D2A6AFB93531605DBE56DC2EEE74C4C986D26E1E27076265463DF496B92A71870719B6A5F27120C115AE0E668FE3A8C10699F11A20A4EB6EA283A6A7945D52713AFD189A0A2E8E2B758CF2255EE337349B174AE6AAC6FA2A5387C39A58E1DCA6.E622D1D9BB17EB1746B0DAA1B2B039DF385091A4441D6D99461FF2597C211498"
step = 9999
url = "https://sports.lifesense.com/sport_service/sport/sport/uploadMobileStepV2?accesstoken=" + token + "&userId=" + userId + "&appType=6&longitude=360&latitude=360&network_type=wifi&systemType=1&version=4.6.1&osversion=12.3.1&platform=ios&screenwidth=320&screenheight=568&requestId=0ee82a94c139470686968a3f9b4a8089&area=CN&language=zh&openudid=933BFE46-60C7-4869-86EF-93FBF14F5EAD&devicemodel=iPhone%20SE&os_country=CN&os_langs=zh&promotion_channel=app_store&timezone=Asia/Shanghai"
pyload = {'timestamp': int(round(time.time())), 'list': [{'calories': '0', 'created': datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S'), 'dataSource': '3',
'deviceId': 'M_FE37336EBAD9788C46D99ACBA06A33CD923189CA', 'distance': '0',
'id': '4610b81308c05444f93b8ce5ccd1ca026fd',
'measurementTime': datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S'), 'priority': '0', 'step': step,
'type': '0', 'userId': userId}]}
headers = {
"Content-Type": "application/json; charset=UTF-8",
"Cookie": ck
}
today = datetime.date.today()
kaoyan_day = datetime.date(2021,1,1) # 倒计时
date = (kaoyan_day - today).days
#love_day = datetime.date(2020,12,21) # 纪念日计算比如和对象在一起xx天
#date = (today - love_day).days
one = requests.get('https://api.qinor.cn/soup/').text # 每日一句的api
title="刷步数成功"
content = (
"### 已提交步数\n" + str(step) + "步\n"
"### 元旦倒计时\n距元旦还有" + str(date) + "天,主人每天要开心啊!\n" #对应上面的倒计时
# "### 已经在一起" + str(date) + "天啦!\n" #对应上面的纪念日
"### 今日一句\n" + one + "\n")
url2 = 'https://sc.ftqq.com/SCU108865Tc03251108f6869e7d804e0f9daaccc455f2febd5e350e.send'
response = requests.post(url2, params={"text":title, "desp":content}).text
result = json.loads(response)
return result;
def main_handler(event, context):
return start()
if __name__ == '__main__':
start();
\ No newline at end of file
File added
# 玩家出拳
\ No newline at end of file
# 玩家出拳
player = input("请出拳(石头/剪刀/布):")
print("玩家出拳:"+player)
# 计算机随机出拳
import random
list = ["石头","剪刀", "布"]
computer = random.choice(list)
print("计算机出拳:"+computer)
if player in list:
# 显示结果
if player == computer:
print("平局")
elif (player=="石头" and computer=="剪刀")or(player=="剪刀" and computer=="布")or(player=="布" and computer=="石头"):
print("恭喜,你赢了")
else:
print("很遗憾,你输了")
else:
print("输入有误!")
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment