Compare commits

..

4 Commits

4 changed files with 55 additions and 53 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
./alert/bark/option.json
alert/bark/option.json

View File

@ -21,9 +21,6 @@ def usage():
def getParams(params):
if len(params) < 2 or len(params) > 11:
print('Need at least 2 parameters, and most can have 11 parameters, exiting...')
exit(99)
params_dict = {'title': '', 'body': '', 'sound': '', 'icon': '', 'group': 'alert', 'copy': '', 'autocopy': '', 'badge': '', 'url': '', 'isarchive': '1', 'level': 'active'}
elements = ['title', 'body', 'sound', 'icon', 'group', 'copy', 'autocopy', 'badge', 'url', 'isarchive', 'level', 'ciphertxt', 'device_key']
@ -38,7 +35,8 @@ def getParams(params):
def main():
if len(sys.argv) == 1:
if len(sys.argv) < 3:
print('Need at least 2 parameters, and most can have 11 parameters, exiting...')
usage()
params = sys.argv[1:]

View File

@ -1 +0,0 @@
{"title": "TODO TIPS", "body": "Today, you NEED to finish the following task:\n a. +life | Happy weekend~\n\n18 days left to finish the following task:\n a. +cici | Special day for Cici(last for 0821)\n\n49 days left to finish the following task:\n a. +microsoft | Azure 100\u7eed\u8ba2\n\n58 days left to finish the following task:\n a. +simcard | \u79fb\u52a8\u5361\u7eed\u7ea6\uff0c\u6c38\u4e459\u5143/\u6708\n\nSo, hurry up!! Go get things done!!", "sound": "", "icon": "", "group": "alert", "copy": "", "autocopy": "", "badge": "", "url": "", "isarchive": "1", "level": "active"}

View File

@ -1,4 +1,9 @@
#!/usr/bin/python3
# 脚本接收两个及以上的参数
# 第一个参数:邮件主题
# 第二个参数:邮件文本内容
# 其他参数:邮件附件
from email.mime.text import MIMEText
from email.mime.image import MIMEImage