An chorme extension that can help you insert the leetcode problems and your code into your notion data base
This project allows users to automatically save LeetCode problems and solutions to a Notion database using a Chrome extension and a proxy server.
- Automatically fetch LeetCode problem details and code.
- Save the fetched data to a Notion database.
- Use a proxy server to handle CORS issues.
leetcode_to_notion/
: The Chrome extension to fetch LeetCode data.notion-proxy/
: The proxy server to handle Notion API requests.
git clone https://github.com/xiangxichen26/lc_notion_sync_chorme_extension.git
cd lc_notion_sync_chorme_extension
- Go to https://www.notion.so/profile/integrations
- Create an api
- Get the api token
- Duplicate my notion template https://www.notion.so/0619986c00ba45c9bea6db875920ab30?v=73a2ebfcd91744e2a08154fdffe8333f&pvs=4
- Get your database id:
- Connect your database with your api
- Navigate to the lc_to_notion directory:
cd lc_to_notion
- Navigate to the background.js file and add your notion api token, database id and port
const NOTION_TOKEN = 'your api token';
const DATABASE_ID = 'your database id';
const PROXY_URL = 'your PROXY_URL';
- Navigate to the notion-proxy directory:
cd notion-proxy
- Install dependencies:
npm install
- Create a .env file in the notion-proxy directory and add your Notion API token:
NOTION_TOKEN=your_notion_token
PORT=3000
- Start the proxy server:
npm start
- Open Chrome and go to chrome://extensions/.
- Enable "Developer mode" (toggle on the top right).
- Click "Load unpacked" and select the lc_to_notion directory.
- Update the background.js file in the extension to point to your proxy server URL:
const PROXY_URL = 'http://localhost:3000/notion'; // or your deployed server URL
- Navigate to a LeetCode problem page.
- Click on the Chrome extension icon.
- The problem details and code will be automatically saved to your Notion database.