Sync-Notion

March 1, 2024

Syncing Wechat Book Notes, Github Trending, Memos to Notion automatically

This project supports the synchronization of WeChat book notes, GitHub trending, and memos to Notion. It can be done locally or through regular GitHub actions, which can be customized according to your preferences.

English | 简体中文

Requirements

Python 3.10

Synchronizing WeChat Book Notes

Usage

  1. Star this project.
  2. Fork this repository.
  3. Obtain the WeChat book's Cookie.
    • Open https://weread.qq.com/ in your browser.
    • Scan the QR code with WeChat and confirm login. Ignore any permission errors.
    • Press F12 to enter developer mode, then follow Network -> Doc -> Headers-> cookie. Copy the Cookie string.
  4. Get the Notion Token.
  5. Copy this Notion template, delete all the data, and click the settings button in the top right corner. Add the integration you created under Connections.
  6. Get the Notion Database ID.
  7. Add the following variables to your GitHub Secrets to enable daily automatic synchronization:
    • Open your forked repository, click Settings -> Secrets and variables -> New repository secret.
    • Add the following variables (you can customize the variable names as long as they match the names in the action):
      • WEREAD_COOKIE
      • NOTION_TOKEN
      • NOTION_DATABASE_ID
  8. Alternatively, you can run the script locally:
Loading...

Supported Configuration Options

Loading...
  • ContentType: Specifies the organization format of the note content blocks as paragraph/list/callout.
  • EnableEmoj: Disables emojis.
  • EnableReadingDetail: Add reading detail info to notes

Synchronizing GitHub Trending

Usage

The process is similar to synchronizing WeChat book notes.

  1. Get the Notion Token (can be reused).
  2. Create a Notion Database and get the Notion Database ID. Use this template for reference.
  3. To run locally:
Loading...
  1. Or add the following variables to your GitHub Secrets for daily automatic synchronization:
    • Open your forked repository, click Settings -> Secrets and variables -> New repository secret.
    • Add the following variables (you can customize the variable names as long as they match the names in the action):
      • NOTION_TOKEN
      • NOTION_DATABASE_TRENDING
      • GIT_TOKEN (optional if you don't need repository information such as forks, stars, and watchers)

Supported Configuration Options

Loading...
  • languages: The programming languages of the repositories to follow. This field cannot be empty.

Syncing Memos to Notion

Usage

The process is similar to syncing WeChat book notes.

  1. Obtain a Notion Token (can be reused)
  2. Create a Notion Database and get its ID. The Notion template can be referenced from here
  3. Assign a unique Token to the user on the Memos platform for accessing Memos.
  4. Modify the configuration file to set the Memos host address and the user's UserName for pulling data. Note that the Token assigned to the user must match the UserName to access Private memos.
  5. Run locally with the following command:
Loading...
Loading...

It is also possible to configure GitHub Actions for regular syncing by modifying the action and configuring the corresponding environment variables.

Loading...

Acknowledgments

 

 

See all postsSee all posts