# -*- coding: utf-8 -*-  

import requests
import time

file = open("/sys/class/thermal/thermal_zone0/temp")   
temp = float(file.read()) / 1000  
file.close()   
url = '这里改成你自己server酱的POST地址'
d = {'text': '温度播报' , 'desp':time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) + "\n\n当前温度:%.1f" %temp}
r = requests.post(url,data=d)
print(r.text)




Last modification:May 10th, 2023 at 01:09 pm
If you think my article is useful to you, please feel free to appreciate