Skip to content

An chorme extension that can help you insert the leetcode problems and your code into your notion data base

License

Notifications You must be signed in to change notification settings

xiangxichen26/lc_notion_sync_chorme_extension

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lc_notion_sync_chorme_extension

An chorme extension that can help you insert the leetcode problems and your code into your notion data base

LeetCode to Notion

This project allows users to automatically save LeetCode problems and solutions to a Notion database using a Chrome extension and a proxy server.

Features

  • Automatically fetch LeetCode problem details and code.
  • Save the fetched data to a Notion database.
  • Use a proxy server to handle CORS issues.

Components

  • leetcode_to_notion/: The Chrome extension to fetch LeetCode data.
  • notion-proxy/: The proxy server to handle Notion API requests.

Installation

Step 1: Clone the repository

git clone https://github.com/xiangxichen26/lc_notion_sync_chorme_extension.git
cd lc_notion_sync_chorme_extension

Step 2: Create the Notion Api and get the token & Database Id

  1. Go to https://www.notion.so/profile/integrations
  2. Create an api image
  3. Get the api token image
  4. Duplicate my notion template https://www.notion.so/0619986c00ba45c9bea6db875920ab30?v=73a2ebfcd91744e2a08154fdffe8333f&pvs=4
  5. Get your database id: image
  6. Connect your database with your api image
  7. Navigate to the lc_to_notion directory:
cd lc_to_notion
  1. 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';

Step 3: Set up the Notion Proxy

  1. Navigate to the notion-proxy directory:
cd notion-proxy
  1. Install dependencies:
npm install
  1. Create a .env file in the notion-proxy directory and add your Notion API token:
NOTION_TOKEN=your_notion_token
PORT=3000
  1. Start the proxy server:
npm start

Step 4: Set up the Chrome Extension

  1. Open Chrome and go to chrome://extensions/.
  2. Enable "Developer mode" (toggle on the top right).
  3. Click "Load unpacked" and select the lc_to_notion directory.
  4. 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

Usage

  1. Navigate to a LeetCode problem page.
  2. Click on the Chrome extension icon.
  3. The problem details and code will be automatically saved to your Notion database.

About

An chorme extension that can help you insert the leetcode problems and your code into your notion data base

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published