Git Product home page Git Product logo

sync-notion's Introduction

Example Page

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:
pip install -r requirements.txt
python3 ./main.py sync_weread ${WEREAD_COOKIE} ${NOTION_TOKEN} ${NOTION_DATABASE_ID}

Supported Configuration Options

[weread.format]
ContentType = list
EnableEmoj = false
EnableReadingDetail = true
  • 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:
pip install -r requirements.txt
python3 ./main.py sync_trending ${NOTION_TOKEN} ${NOTION_DATABASE_TRENDING} --git_token=${GIT_TOKEN}
  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

[trending.language]
languages = python,go
  • 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:
python3 ./main.py sync_memos ${NOTION_TOKEN} ${DATABASE_ID} ${MEMOS_TOKEN}
[memos.opts]
MemosHost = http://127.0.0.1:8081
; Username, not nickname
MemosUserName = memos-demo

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

# Configure the corresponding environment variables in git and set the action run command
python3 ./main.py sync_memos "${{secrets.NOTION_TOKEN}}" "${{DATABASE_ID}}" "${{MEMOS_TOKEN}}"

Acknowledgments

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.