Programmer's romantic realization: push messages to Ta regularly every day to remind the nanny of the super detailed tutorial
Write in front
Implementation effect preview
Step teaching
-
One Windows computer. It is recommended that win10 or above systems, and win7 systems may have some bugs -
A pair of industrious hands
1. Download program
explain:
1. Config.txt: the program configuration file to configure your own information, which will be described in detail in subsequent tutorials
2. Main.exe: executable program of program main entry
2. Apply for WeChat test number and parameters
-
Browser URL: https://mp.weixin.qq.com/debug/cgi-bin/sandbox?t=sandbox/login , open the WeChat public platform interface test account application platform, and scan WeChat to log in. -
Remember the test number information after login: appID and appsecret , we will use -
Pull down and open WeChat code scanning to follow the test number, and then refresh it. WeChat information will appear on the right, which needs to be pushed to several people. Remember this WeChat, and we will use it later Find the template message interface and click Add Test Template. The template title is the title pushed from the public account. The template content can refer to the following: Remember the template ID after adding, and we will use it later {{date.DATA}} City: {{city. DATA}} Weather: {{weather. DATA}} Minimum temperature: {{min_temperature. DATA}} Maximum temperature: {{max_temperature. DATA}} Today is the {{love_day. DATA}} day of our love {{birthday1. DATA}} days before the first girlfriend's birthday {{birthday2. DATA}} days before the second girlfriend's birthday {{birthday3. DATA}} days before the third girlfriend's birthday {{note_en.DATA}} {{note_ch.DATA}} -
Note: Please do not add or modify the information not mentioned on the page.
3. Modify configuration information
{ #Public account configuration #The public account appId needs to be modified to the appID obtained in step 2 "app_id": "", #The public account appSecret needs to be modified to the appsecret obtained in step 2 "app_secret": "", #The template message ID needs to be modified to the template ID obtained after adding the template in step 2 "template_id": "", #If there are multiple WeChat signals receiving public account messages, they need to be separated by commas in [], such as ["wx1", "wx2"], and need to be modified to the WeChat signals obtained in step 2 "user": [""], #Information configuration #All cities in the province are shown in the appendix "Province": "Sichuan", #City "City": "Chengdu", #Birthday 1 corresponds to the content in the template file {{birthday1. DATA}} "birthday1": "1997-01-01", #Birthday 2 corresponds to the content in the template file {{birthday2. DATA}} "birthday2": "1999-12-01", #Birthday 3 corresponds to the content in the template file {{birthday3. DATA}} "birthday3": "1990-05-01", #Same format as above for the days together "love_date": "2022-04-05" }
4. Run program
5. Set daily scheduled push (optional)
-
Search Box Search Task Scheduler -
Click on the right to create a new task with a name that describes customization -
Click Trigger to create a new trigger -
Define the time and frequency you want to execute, such as 8 o'clock every day. Check Enabled -
Click Operation to create a new operation -
Program or script selection main.exe The path, starting from the location where the directory is filled in -
Condition removal check (this task can only be started when the computer is using AC power) -
Set check (if the planned start time is over, start the task immediately) -
Automatic push when waiting for the set time
common problem
Double click to run and report an error. This program cannot be started because api ms win core path 1-1-0.dll is missing from the computer? Answer: This error is that the computer lacks some components necessary for running, which usually appears on the win7 system. It is recommended to replace the computer or download the corresponding patch from Baidu before running. Double click the operation prompt Unhandled exception in script? A: Please check your config.txt For configuration files, all commas are in English, and don't add too many double quotes. The correct format for pushing multiple accounts is "user": ["11111111", "2222222", "3333333"], The running program did not report an error, but did not receive a message push? Answer: The message is displayed in the subscription number. If it is checked or not, please log out of the application test number again and log in again. Compare whether the appID and appSecret have changed. If they have changed, fill in and save again and try again. Can I change the name of the test number xxxx? Answer: No, only authenticated public accounts can be modified. Can you not push the last two lines of the message? Answer: Yes, you can only delete the last two lines of the template. That text changes every day, so you are not recommended to delete it.
Extended Reading
How to set daily scheduled task push? Answer: There are many ways to implement it. Please implement it according to your own situation. 1. Add Windows planned task management; 2. Run in Python source code mode, and Linux provides crontab scheduled task operation; 3. Third party pagoda panel plan task realization; 4. The github action script can run regularly How to add regular water drinking reminder? A: Just add a new template and write the content. As long as you master the principle, please use your imagination in a fun way.
listen for