LeetCode Crawler

LeetCode Crawler

This phrase is a bit ambiguous. To translate it accurately, I need to understand the intended meaning. Here are a few possible interpretations and their corresponding Chinese translations: **1. Meaning: A server using MCP (Minecraft Protocol?) to crawl interview questions from a discussion forum (likely related to Minecraft).** * **Chinese Translation:** 一个使用 MCP 协议从讨论区抓取面试问题的服务器 (Yī gè shǐyòng MCP xiéyì cóng tǎolùn qū zhuāqǔ miànshì wèntí de fúwùqì) **2. Meaning: A server (likely a computer server) used to crawl interview questions from a discussion forum, possibly using a method called "MCP" (unlikely, but possible).** * **Chinese Translation:** 一个用于从讨论区抓取面试问题的服务器 (Yī gè yòng yú cóng tǎolùn qū zhuāqǔ miànshì wèntí de fúwùqì) - This is the most likely translation if "MCP" is not a specific protocol. **3. Meaning: A server (likely a computer server) for crawling interview questions in a discussion forum, and the server is managed using MCP (Management Console Protocol or similar).** * **Chinese Translation:** 一个用于抓取讨论区面试问题的服务器,该服务器使用 MCP 管理 (Yī gè yòng yú zhuāqǔ tǎolùn qū miànshì wèntí de fúwùqì, gāi fúwùqì shǐyòng MCP guǎnlǐ) **Breakdown of the Chinese words used:** * **一个 (yī gè):** a / one * **使用 (shǐyòng):** to use * **协议 (xiéyì):** protocol * **从 (cóng):** from * **讨论区 (tǎolùn qū):** discussion area / forum * **抓取 (zhuāqǔ):** to crawl / to scrape / to grab * **面试问题 (miànshì wèntí):** interview questions * **的 (de):** of / 's (possessive particle) * **服务器 (fúwùqì):** server * **用于 (yòng yú):** used for * **该 (gāi):** this / that * **管理 (guǎnlǐ):** to manage / management **To give you the best translation, please clarify what "MCP" refers to in this context.** Is it a specific protocol, a software package, or something else? Knowing this will allow me to provide a more accurate and helpful translation.

louisfghbvc

研究与数据
访问服务器

README

LeetCode 爬虫

一个全面的工具,用于爬取 LeetCode 讨论区中的面试问题,尤其侧重于来自 Google 面试的问题。该工具从讨论中提取有价值的信息,按月份组织,并允许导出为各种格式,包括 CSV 和 Google Sheets。

功能

  • 从 LeetCode 讨论区爬取面试问题
  • 按公司标签过滤(默认:Google)
  • 提取详细信息,包括问题链接
  • 按月份对结果进行分组
  • 保存到 CSV 文件,便于分析
  • 导出到 Google Sheets,带有格式化的工作表
  • 命令行界面,使用灵活

安装

  1. 克隆此仓库:

    git clone https://github.com/yourusername/mcp-leetcode-crawler.git
    cd mcp-leetcode-crawler
    
  2. 安装所需的依赖项:

    pip install -r requirements.txt
    

用法

基本用法

使用默认设置运行爬虫:

python crawler.py

这将:

  1. 爬取 LeetCode 讨论区中关于 Google 面试的问题
  2. 将所有帖子保存到单个 CSV 文件 (leetcode_interview_questions.csv)
  3. 按月份对帖子进行分组,并将它们保存到 output 目录中的单独 CSV 文件中

命令行界面

为了更好地控制,请使用 CLI:

python cli.py --company google --pages 20 --output results.csv --output-dir monthly_data

可用选项:

  • --company: 用于过滤问题的公司标签(默认:google)
  • --pages: 要爬取的页数(默认:10)
  • --output: 输出 CSV 文件路径(默认:leetcode_interview_questions.csv)
  • --output-dir: 用于每月输出文件的目录(默认:output)
  • --verbose: 启用详细日志记录
  • --category: 要爬取的类别(默认:interview-question)

导出到 Google Sheets

要将数据导出到 Google Sheets:

  1. 设置 Google Sheets API 凭据:

    • 转到 Google Cloud Console
    • 创建一个新项目
    • 启用 Google Sheets API
    • 创建 OAuth 2.0 凭据(桌面应用程序)
    • 将凭据下载为 credentials.json 到您的项目目录
  2. 运行导出器脚本:

    # 导出单个 CSV 文件
    python google_sheets_exporter.py --csv leetcode_interview_questions.csv --name "Google Interview Questions"
    
    # 导出所有每月数据
    python google_sheets_exporter.py --monthly --name "LeetCode Interview Questions by Month"
    

自动运行

使用提供的 shell 脚本:

# 基本运行(仅 CSV)
./run.sh

# 运行并导出到 Google Sheets
./run_with_sheets.sh

项目结构

  • crawler.py - 主要爬虫实现
  • cli.py - 命令行界面
  • google_sheets_exporter.py - 用于将数据导出到 Google Sheets 的实用程序
  • run.sh - 用于基本执行的 Shell 脚本
  • run_with_sheets.sh - 用于执行并导出到 Google Sheets 的 Shell 脚本
  • requirements.txt - Python 依赖项

自定义

您可以修改脚本以:

  • 更改公司标签(例如,从“google”到“facebook”、“amazon”等)
  • 调整要爬取的页数
  • 修改输出格式
  • 更改数据的分组和组织方式

未来改进

  • [ ] 添加对同时使用多个公司标签的支持
  • [ ] 实施自动调度以进行定期数据更新
  • [ ] 添加一个 Web 界面,以便更轻松地交互
  • [ ] 与其他数据存储解决方案集成(例如,MongoDB)
  • [ ] 添加数据可视化功能
  • [ ] 为收集的数据实现全文搜索

许可证

MIT

推荐服务器

Crypto Price & Market Analysis MCP Server

Crypto Price & Market Analysis MCP Server

一个模型上下文协议 (MCP) 服务器,它使用 CoinCap API 提供全面的加密货币分析。该服务器通过一个易于使用的界面提供实时价格数据、市场分析和历史趋势。 (Alternative, slightly more formal and technical translation): 一个模型上下文协议 (MCP) 服务器,利用 CoinCap API 提供全面的加密货币分析服务。该服务器通过用户友好的界面,提供实时价格数据、市场分析以及历史趋势数据。

精选
TypeScript
MCP PubMed Search

MCP PubMed Search

用于搜索 PubMed 的服务器(PubMed 是一个免费的在线数据库,用户可以在其中搜索生物医学和生命科学文献)。 我是在 MCP 发布当天创建的,但当时正在度假。 我看到有人在您的数据库中发布了类似的服务器,但还是决定发布我的服务器。

精选
Python
mixpanel

mixpanel

连接到您的 Mixpanel 数据。 从 Mixpanel 分析查询事件、留存和漏斗数据。

精选
TypeScript
Sequential Thinking MCP Server

Sequential Thinking MCP Server

这个服务器通过将复杂问题分解为顺序步骤来促进结构化的问题解决,支持修订,并通过完整的 MCP 集成来实现多条解决方案路径。

精选
Python
Nefino MCP Server

Nefino MCP Server

为大型语言模型提供访问德国可再生能源项目新闻和信息的能力,允许按地点、主题(太阳能、风能、氢能)和日期范围进行筛选。

官方
Python
Vectorize

Vectorize

将 MCP 服务器向量化以实现高级检索、私有深度研究、Anything-to-Markdown 文件提取和文本分块。

官方
JavaScript
Mathematica Documentation MCP server

Mathematica Documentation MCP server

一个服务器,通过 FastMCP 提供对 Mathematica 文档的访问,使用户能够从 Wolfram Mathematica 检索函数文档和列出软件包符号。

本地
Python
kb-mcp-server

kb-mcp-server

一个 MCP 服务器,旨在实现便携性、本地化、简易性和便利性,以支持对 txtai “all in one” 嵌入数据库进行基于语义/图的检索。任何 tar.gz 格式的 txtai 嵌入数据库都可以被加载。

本地
Python
Research MCP Server

Research MCP Server

这个服务器用作 MCP 服务器,与 Notion 交互以检索和创建调查数据,并与 Claude Desktop Client 集成以进行和审查调查。

本地
Python
Cryo MCP Server

Cryo MCP Server

一个API服务器,实现了模型补全协议(MCP),用于Cryo区块链数据提取,允许用户通过任何兼容MCP的客户端查询以太坊区块链数据。

本地
Python