shiquda

shiquda

ETW -- Explore The World.
github
telegram
steam

wereadcard: WeChat Reading Card Generator

Today I created a WeChat Reading Card Generator as a hobby and practice. I wrote a blog post about it. Welcome to Star.

shiquda/wereadcard (github.com)

Demo:

github:

raw.githubusercontent.com/shiquda/wereadcard/main/output/recent_read.svg

If it doesn't load, there is also a mirror site:
raw.kkgithub.com/shiquda/wereadcard/main/output/recent_read.svg

Here is the introduction. Of course, it is recommended to go to Github to view it directly, as the version here may be outdated.


Introduction#

This project uses Github Actions to automatically fetch WeChat Reading records and generate .svg cards for display.

Usage#

Using Github Actions#

Here is just one method:

Go to https://weread.qq.com/, scan the QR code to log in to WeChat Reading.

Use the F12 console tool, open Network, refresh the page, filter Fetch/XHR, select any request, then find the Cookie in the Headers section, and copy the corresponding string.

Github configuration#

  1. Fork this repository.
  2. In your repository, go to Settings > Secrets and variables > Actions, and add Repository secrets:
  3. [Required]: WEREAD_COOKIE, add the WeChat Reading cookie string copied in the previous step.
  4. [Optional]: BOOK_COUNT, default is 4, the number of books displayed in the image, it is recommended not to exceed 5.
  5. Go to Settings > Actions > General, find Workflow permissions, change it to Read and write permissions, and click Save.

Now Github Actions will update the image every 8 hours by default, and push it to the repository. The updated card can be found in /output/recent_read.svg.

Of course, you can also manually trigger Actions.

In GitHub, go to the image, Raw corresponds to the direct link. If the network environment is not good, you can consider using a mirror site for acceleration by replacing githubusercontent in the URL with kkgithub, like this:

Replace it with

Local usage#

Clone this repository, then install the dependencies:

There are two ways to use it: you can directly configure the cookie and other parameters in main.py, and then run it directly, or use command line parameters:

  • --cookie, -c: cookie string, make sure to add quotes around the string.
  • --number, -n: the number of books in the generated card.

After running, the generated card can be found in the /output directory.

Acknowledgements#

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.