复制 Markdown

· · 科技·工程

复制洛谷部分页面 Markdown 源代码。

使用

点击右上角按钮复制源代码到剪贴板。

特别地,比赛、训练页面按钮位于比赛标题下方。

安装

推荐使用 cos 方式进行安装,greasyfork 需要你有稳定的国际网络连接。

原理

容易发现。洛谷专栏获取到的数据以 JSON 格式存在 script[id="lentille-context"] 标签内,我们只需要解析该元素即可。

添加 x-lentille-request: content-only headers 即可获取 JSON 格式的返回数据。

对于比赛、训练和个人主页,其 Markdown 源代码分别位于 _feInstance.currentData.contest.description_feInstance.currentData.training.description_feInstance.currentData.user.introduction

更新

更新日志

v1.2.0

v1.1.2

add headers for fetching clean JSON data

v1.1.1

fix bugs.

v1.1.0

TODO