Skip to content
This repository has been archived by the owner on Jul 8, 2023. It is now read-only.

gitzhou/fetch-leetcode-submission

Repository files navigation

抓取 LeetCode OJ 个人提交的代码

  • Gradle 构建项目
  • 从接口取回用户的提交记录(接口返回的数据示例
  • HttpClient、jsoup 抓取、解析网页

使用说明

  • 进入release文件夹
  • 修改init.properties 中的配置
#登录账号
username=your_username

#登录密码
password=your_password

#登录类型,值暂时只能为leetcode或github
logintype=leetcode

#抓取的代码在本地的存储目录
#注意目录路径最后需有一个斜杠/
dirpath=/path/to/your/own/directory/

#是否抓取所有的提交代码
#为假时参考tags集合的取值有选择的抓取
isfetchall=false

#抓取与集合中状态匹配的代码
tags=Accepted,Wrong Answer,Time Limit Exceeded
  • 命令行中运行 java -jar FetchLeetcodeSubmission.jar 抓取代码
  • 输出的代码文件,内容依次为
    • 本项目信息
    • 题目标题
    • 题目URL
    • 你提交的代码

项目说明

  • 使用gradle release可直接打包最新项目到release文件夹
jar {
    from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
    manifest {
        attributes 'Main-Class': 'cc.aaron67.fetch.leetcode.main.Main'
    }
}

task release(type: Copy) {
    from 'build/libs'
    into 'release'
}

task copyConfig(type: Copy) {
    from 'init.properties'
    into 'release'
}

release.dependsOn 'build', 'copyConfig'

LICENSE

项目基于GPL协议发布

About

抓取 LeetCode OJ 个人提交的代码

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages