Home  >  Article  >  [Super simple in 5 minutes~Latest version] WeChat public account + Github free morning scheduled push with weather, anniversaries, birthdays, scheduled push, etc.

[Super simple in 5 minutes~Latest version] WeChat public account + Github free morning scheduled push with weather, anniversaries, birthdays, scheduled push, etc.

青灯夜游
青灯夜游Original
2022-09-19 16:50:475647browse

How much does the romance of programmers make you happy? This tutorial can help friends who don’t understand programming get started quickly. Considering that it costs money to build a server to perform scheduled tasks, the editor thought that this function can be used for free using Github Actions without spending a penny.

Without further ado, let’s get straight to the pictures and text. The girlfriend’s exclusive public account has a good morning push, which can automatically push weather conditions and reminder information every day, and can also remind her to bring an umbrella on rainy days.

1. First, you need to apply for a WeChat public platform test account

Application address: https://mp.weixin. qq.com/debug/cgi-bin/sandbox?t=sandbox/login

Click to log in and scan the WeChat code to log in.

[Super simple in 5 minutes~Latest version] WeChat public account + Github free morning scheduled push with weather, anniversaries, birthdays, scheduled push, etc.

# After successfully logging in, you will get a test account and the appID and appsecret of the test account, as shown below.

[Super simple in 5 minutes~Latest version] WeChat public account + Github free morning scheduled push with weather, anniversaries, birthdays, scheduled push, etc.

Continue to scroll down the current page and ask your girlfriend or boyfriend to scan the QR code to follow the test account. Then his nickname and USER_ID will appear in the user list, as follows picture.

[Super simple in 5 minutes~Latest version] WeChat public account + Github free morning scheduled push with weather, anniversaries, birthdays, scheduled push, etc.

Then click [Add Test Template]

[Super simple in 5 minutes~Latest version] WeChat public account + Github free morning scheduled push with weather, anniversaries, birthdays, scheduled push, etc.

[Super simple in 5 minutes~Latest version] WeChat public account + Github free morning scheduled push with weather, anniversaries, birthdays, scheduled push, etc.

Sample template:

Today’s weather: {{ weather.DATA }}

Humidity: {{ humidity.DATA }}

Current temperature: {{ temperature.DATA }}

We are already in love{{ love_days.DATA }} Oh my god

There are still days left until your birthday: {{ birthday_left.DATA }} days

{{ words.DATA }}

After submission You can get the unique template ID, as shown below.

[Super simple in 5 minutes~Latest version] WeChat public account + Github free morning scheduled push with weather, anniversaries, birthdays, scheduled push, etc.

2. Prepare github Action scheduled tasks

Open github and find 13812851221/-rxrw-daily_morning this The repository then forks into its own repository.

[Super simple in 5 minutes~Latest version] WeChat public account + Github free morning scheduled push with weather, anniversaries, birthdays, scheduled push, etc.

##Go back to your warehouse, set the variables, and create the red circled string on the WeChat public platform to GitHub according to the instructions -> Settings -> Secrets -> Actions.

[Super simple in 5 minutes~Latest version] WeChat public account + Github free morning scheduled push with weather, anniversaries, birthdays, scheduled push, etc.

Click 3 in the picture above to create a behavior variable.

[Super simple in 5 minutes~Latest version] WeChat public account + Github free morning scheduled push with weather, anniversaries, birthdays, scheduled push, etc.

Repeat the above operation and add the following behavioral variables in order, no one is missing, and the format cannot be wrong.

[Super simple in 5 minutes~Latest version] WeChat public account + Github free morning scheduled push with weather, anniversaries, birthdays, scheduled push, etc.

3. Enable Action under your own project!

Click Actions

[Super simple in 5 minutes~Latest version] WeChat public account + Github free morning scheduled push with weather, anniversaries, birthdays, scheduled push, etc.

[Super simple in 5 minutes~Latest version] WeChat public account + Github free morning scheduled push with weather, anniversaries, birthdays, scheduled push, etc.

[Super simple in 5 minutes~Latest version] WeChat public account + Github free morning scheduled push with weather, anniversaries, birthdays, scheduled push, etc.

[Super simple in 5 minutes~Latest version] WeChat public account + Github free morning scheduled push with weather, anniversaries, birthdays, scheduled push, etc.

[Super simple in 5 minutes~Latest version] WeChat public account + Github free morning scheduled push with weather, anniversaries, birthdays, scheduled push, etc.

[Super simple in 5 minutes~Latest version] WeChat public account + Github free morning scheduled push with weather, anniversaries, birthdays, scheduled push, etc.##The above error message is intentional by the editor LOL, 41004 is appsecret missing error, as follows Just remove the image and add it again.

[Super simple in 5 minutes~Latest version] WeChat public account + Github free morning scheduled push with weather, anniversaries, birthdays, scheduled push, etc.#Then run the workflow again, as shown below.

[Super simple in 5 minutes~Latest version] WeChat public account + Github free morning scheduled push with weather, anniversaries, birthdays, scheduled push, etc.

[Super simple in 5 minutes~Latest version] WeChat public account + Github free morning scheduled push with weather, anniversaries, birthdays, scheduled push, etc.

[Super simple in 5 minutes~Latest version] WeChat public account + Github free morning scheduled push with weather, anniversaries, birthdays, scheduled push, etc.Wait for 2s, as shown in the picture above, it means success.

Check to see if your girlfriend’s phone has received the push notification! This scheduled task is pushed every morning at 9 o'clock. If you can program, you can customize some things by yourself~

[Super simple in 5 minutes~Latest version] WeChat public account + Github free morning scheduled push with weather, anniversaries, birthdays, scheduled push, etc.

The above operations, except for the different English strings, templates The Chinese in the message is different, and everything else should be the same, otherwise the program will not work~

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn