Skip to content

A program that extracts data from a Leetcode list and posts it into a Notion database

Notifications You must be signed in to change notification settings

RalphAlexander/Leetcode-Webscraper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Leetcode Webscraper

A LeetCode webscraper to automate uploading questions into a Notion database for one's personal use, a finished template can be downloaded which feature questions from the LeetCode 75 list.

Table of Contents

Project Overview

Extracts data from the LeetCode 75 list and posts it in a Notion database.

Leetcode-List_Preview

Here is a preview of the resulting database:

Notion-Database_Preview

Click here for the Notion Database Template.
Site is currently in work in progress

Installation

  1. Clone the repository:

    git clone https://github.com/FishTomato/Leetcode-Webscraper
    
  2. Install the required dependencies

    npm install
    
  3. Set up environment variables:

    • Create a .env file in the root directory of the project.
    • Add the following environment variables to the .env file:
       PORT=3000
       NOTION_KEY=<your_notion_api_key>
       NOTION_DATABASE_ID=<your_notion_database_id>
       NOTION_DIFFICULTY_ID=<your_notion_difficulty_column_id>
       NOTION_TOPICS_ID=<your_notion_topics_column_id>
       NOTION_NUMBER_ID=<your_notion_number_column_id>
       NOTION_URL_ID=<your_notion_url_column_id>
       NOTION_TITLE_ID=<your_notion_title_column_id> 
      
  4. Configure the project:

    Review the scraper.js file and ensure the URL variable is set correctly. Customize the scraping logic in scraper.js as per your requirements. Some functions are properly tuned to scrape leetcode question data given the URL.

Usage

To run the program, use the following command:

node index.js

About

A program that extracts data from a Leetcode list and posts it into a Notion database

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages