I don’t know if anyone else is like me. Ever since I got single, I would compete with my significant other to see who could check in first (message push at 5:20 pm...), and would suddenly be asked how many days we have been together today (sometimes all at once) I really didn’t calculate it...) and would use each other’s birthday numbers to buy lottery tickets (and then forget to see if they hit or not...)
For the above reasons, this project was born...
This project uses the most stable WeChat message push method in history (there will be no risks such as account bans)
At the same time, this project supports custom message timing sending configuration, and has many built-in heartwarming sentences to warm up feelings.
I hope the lovers in this world will last forever!
(Single friends don’t need to be discouraged. Arrange this project first to win your sweetheart as soon as possible!)
WeChat message push
cron scheduled push
Multi-task parallel push
Custom title & content
Random content configuration
Support docker image deployment
pip install -r requirements.txt
This project uses corporate WeChat to push messages to WeChat (personal WeChat can also be registered, no authentication is required, and messages can be viewed directly on WeChat)
First, you need to use a computer to open the official WeChat official website of the enterprise and register an enterprise.
After successful registration, click "Manage Enterprise" to enter the management interface, select "Application Management" → "Self-Build" → "Create Application"
After creation, enter the application details page to get the application ID (agentid) and application Secret (secret)
Enter the "My Business" page, scroll to the bottom, and obtain the corporate ID (corpid)
Enter "My Business" → "WeChat Plug-in", scroll down and scan the QR code, and follow it to receive push messages.
The last step is to write the agentid, secret, and corpid obtained above into config/messenger.json and you're done.
examples/config/messenger.json
[{
"channel": "enterprise_we_chat_app",
"payload": {
"agentid": "1000001",
"corpid": "wweb6a6b9523f30fa4",
"secret": "JF1BC4UvyEW8ZepkVfsg_AlAgjqFpNIslA_hUD78Dso"
}
}]
Used to create scheduled tasks and push messages to WeChat regularly.
Configure in config/cron.json
examples/config/cron.json
[{
"mission": {
"name": "lover_greeting",
"payload": {
"title": "宝贝~ 起床啦~",
"begin_date": "2021-11-10",
"greeting_type": "morning"
}
},
"cron": "00 08 * * *",
"messenger": "enterprise_we_chat_app"
}, {
"mission": {
"name": "lover_greeting",
"payload": {
"title": "宝贝~ 中午啦~",
"greeting_type": "normal"
}
},
"cron": "00 12 * * *",
"messenger": "enterprise_we_chat_app"
},
{
"mission": {
"name": "lover_greeting",
"payload": {
"title": "520 !准时打卡!",
"content": "准时不!",
}
},
"cron": "20 17 * * *",
"messenger": "enterprise_we_chat_app"
}]
There are 3 scheduled message push tasks in the example:
Push a message at 8 a.m.:
宝贝~ 起床啦~ 今天我们在一起 184 天了~
早安!当你睁开双眼,祝福已飞到你面前,带着快乐的旋律,愉悦的心态,滚滚的财源,甜蜜的浪漫和美妙的生活伴你度过美好的一天!
Push a message at 12 noon:
宝贝~ 中午啦~
my baby,...爱你!
Push a message at 5:20 pm:
520 !准时打卡!
准时不!
The begin_date(opt) in the payload represents the time when we started to be together, which is used to calculate the length of time together;
title(opt) in payload represents the pushed title;
greeting_type(opt) in the payload represents the type of lover_greeting push (one will be randomly selected as content in config/builtin_sentences.json);
(If the content(opt) value is set in the payload, it will override the effect of the greeting_type parameter)
python3 main.py
WeChat public account: AI testing frontline