"""使用流程:扫码登录微信网页版 / 若登录成功,则功能可使用,否则不可用"""import timefrom threading import Timerimport requestsfrom wxpy import *bot = Bot() # 连接微信,会出现一个登陆微信的二维码def get_news():"""获取金山词霸每日一句"""url = /dsapi
= requests.get(url)content = r.json()[content]note = r.json()[
ote]return content, notedef send_news():"""指定微信昵称发:return:"""try:contents = get_news()my_friend = bot.friends().search(u珊)[0] # 这里是你微信好友的昵称my_friend.send(contents[0])my_friend.send(contents[1])my_friend.send(好久不见,十分想念)t = Timer(86400, send_news) # 这里是一天发送一次,86400s = 24ht.start()except Exception as e:print(发送失败,异常信息:, e)def
第一句子网 - 唯美句子、句子迷、好句子大全