网易云音乐动态更新的邮件提醒
本帖最后由 傲雪不傲霜 于 2023-4-16 14:30 编辑先在linux系统配置好发件邮箱(或者在windows配置好邮箱并更换发送邮箱命令),再在abc处输入想要获取动态更新提醒的用户id,最后在your_email_address填入自己的邮箱即可。在安装收件软件的手机端或提供邮件提醒的微信公众号即可获得动态更新提示。
import cloudmusic
import os, time, smtplib, socket, sys
def comparedict(ca,cb):
c=[]
for ci in cb:
if ca!=cb:
c.append(ci)
return(c)
a=cloudmusic.getUser(111111111)
b=cloudmusic.getUser(222222222)
c=cloudmusic.getUser(333333333)
your_email_address=...@...com
mid=
countmap0={}
for i in mid:
countmap0=i.eventCount
time.sleep(5)
print(countmap0)
countmap={}
for timestep in range(10):
for i in mid:
countmap=i.eventCount
time.sleep(1)
a=cloudmusic.getUser(111111111)
b=cloudmusic.getUser(222222222)
c=cloudmusic.getUser(333333333)
mid=
print('timestep=%d %s'%(timestep,countmap))
if timestep==0:
os.system('echo "This email is from 52pojie, have fun!" | mail -s "Now starts cm(py)." %s'%your_email_address)
elif timestep==28800000000:
os.system('echo "This email is from 52pojie, have fun!" | mail -s "Program cm(py) ended." %s'%your_email_address)
elif timestep%720==0:
print('timestep=%d %s'%(timestep,countmap))
else:
if comparedict(countmap0,countmap)!=[]:
updater=comparedict(countmap0,countmap)
os.system('echo "This email is from 52pojie, have fun!" | mail -s "%supdated!" %s'%(updater,your_email_address))
sentence='%s'%updater+' updated dynamics.'
print(sentence)
for i in mid:
countmap0=i.eventCount
time.sleep(1)
time.sleep(10) 这个要怎么用,求解 aw668y 发表于 2023-4-16 17:04
这个要怎么用,求解
主要的思路我写在顶上了,把脚本在本地运行一下,一个一个解决报错就可以 学习学习
页:
[1]