This repository has been archived by the owner on Sep 26, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
simpleGuide
HoshinoTented edited this page Dec 30, 2018
·
3 revisions
首先, 您需要下载一个 Kotlin编译器
接着, 在项目根目录的命令行运行以下内容
./gradlew assemble
随后 cd
到 build/libs
执行以下命令:
kotlinc -cp luogu-<version number>.jar:luogu-<version number>-dependencies.jar
之后会进入 强大的 Kotlin REPL
有两种方法可以登录
-
最简单直接的方法
您需要在您已经登录洛谷的浏览器上获得您的以下Cookie
- __client_id
- _uid
之后在
Kotlin REPL
运行以下代码import org.hoshino9.luogu.LuoGu val luogu = LuoGu("您的__client_id", "您的_uid")
-
账号密码登录
首先您需要获取验证码:import org.hoshino9.luogu.LuoGu import java.io.File val luogu = LuoGu() luogu.verifyCode(File("验证码图片输出路径").outputStream())
之后您会在
验证码图片输出路径
得到一个验证码图片
接下来就可以登录了:luogu.login("您的账号", "您的密码", "您获得到的验证码")
在以上的操作之后, luogu
就是洛谷的客户端对象了
org.hoshino9.luogu
org.hoshino9.luogu.user
org.hoshino9.luogu.data
org.hoshino9.luogu.tag
org.hoshino9.luogu.benben
org.hoshino9.luogu.results
org.hoshino9.luogu.training
org.hoshino9.luogu.utils
org.hoshino9.luogu.photo
org.hoshino9.luogu.problem
org.hoshino9.luogu.problem.tags
org.hoshino9.luogu.paste
org.hoshino9.luogu.record
org.hoshino9.luogu.record.response
org.hoshino9.luogu.record.status
org.hoshino9.luogu.record.listener