Skip to content
This repository was archived by the owner on Oct 31, 2026. It is now read-only.

Commit e7e794e

Browse files
committed
Polish site copy, configs and crawler formatting
Tidies up copy, config and formatting across the project. Updates content/about.md with revised project description, features and team credits; adjusts UI text in pages/index.js, pages/login.js (inject SITE_NAME) and pages/register.js (copy edits and button text). Adds allowScripts entries to package.json. Applies minor code-style/whitespace cleanups in auto-crawler.js and normalizes tsconfig.json formatting. Updates wikitdb.config.js sample/comment layout and fixes an ImgURL for the if-backrooms site. Changes are primarily editorial and formatting with a few config additions and a small functional change to show SITE_NAME on the login page.
1 parent f27920f commit e7e794e

8 files changed

Lines changed: 78 additions & 92 deletions

File tree

‎auto-crawler.js‎

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -204,20 +204,20 @@ async function runCrawler() {
204204
await Promise.all(batch.map(async (pageNode) => {
205205
const secureUrl = `${baseUrl}/${pageNode.page}`;
206206
let success = false, attempt = 0;
207-
207+
208208
while (!success && attempt < 3) {
209209
attempt++;
210210
try {
211211
const { data: html } = await request.get(secureUrl, { headers: baseHeaders });
212-
212+
213213
const $page = cheerio.load(html);
214214
let threadId = null;
215-
215+
216216
let href = $page('#discuss-button').attr('href');
217-
if (!href) href = $page('#page-info a').filter((_, el) => ($page(el).attr('href')||'').includes('/forum/t-')).attr('href');
217+
if (!href) href = $page('#page-info a').filter((_, el) => ($page(el).attr('href') || '').includes('/forum/t-')).attr('href');
218218
if (!href) href = $page('#page-content').parent().find('a').filter((_, el) => {
219219
const text = $page(el).text().toLowerCase();
220-
return (text.includes('discuss') || text.includes('讨论') || text.includes('评论')) && ($page(el).attr('href')||'').includes('/forum/t-');
220+
return (text.includes('discuss') || text.includes('讨论') || text.includes('评论')) && ($page(el).attr('href') || '').includes('/forum/t-');
221221
}).attr('href');
222222

223223
if (href) {
@@ -235,7 +235,7 @@ async function runCrawler() {
235235
const $forum = cheerio.load(forumHtml);
236236
const posts = [];
237237
const userIdCache = {};
238-
238+
239239
const postElements = $forum('.post').toArray();
240240
for (const el of postElements) {
241241
const $el = $forum(el);
@@ -251,7 +251,7 @@ async function runCrawler() {
251251

252252
let author = '未知用户';
253253
const $printUser = $el.find('.head .printuser').length ? $el.find('.head .printuser').first() : $el.find('.info .printuser').first();
254-
254+
255255
if ($printUser.length) {
256256
const $links = $printUser.find('a');
257257
if ($links.length) author = $links.last().text().trim();
@@ -299,7 +299,7 @@ async function runCrawler() {
299299
const odate = $el.find('.odate').first();
300300
const odateClass = odate.attr('class') || '';
301301
const timeMatch = odateClass.match(/time_(\d+)/);
302-
302+
303303
let timestamp = odate.text().trim();
304304
if (timeMatch) {
305305
const dateObj = new Date(parseInt(timeMatch[1]) * 1000);
@@ -308,17 +308,17 @@ async function runCrawler() {
308308

309309
posts.push({ postId, parentId, author, avatarUrl, timestamp, contentHtml, children: [] });
310310
}
311-
311+
312312
const postMap = {};
313313
const rootPosts = [];
314314
posts.forEach(p => { p.children = []; postMap[p.postId] = p; });
315-
posts.forEach(p => {
316-
if (p.parentId && postMap[p.parentId]) postMap[p.parentId].children.push(p);
317-
else rootPosts.push(p);
315+
posts.forEach(p => {
316+
if (p.parentId && postMap[p.parentId]) postMap[p.parentId].children.push(p);
317+
else rootPosts.push(p);
318318
});
319-
319+
320320
const forumData = { threadId, url: forumUrl, total: posts.length, threads: rootPosts };
321-
321+
322322
await prisma.setting.upsert({
323323
where: { key: cacheKey },
324324
update: { value: JSON.stringify(forumData) },
@@ -344,7 +344,7 @@ async function runCrawler() {
344344

345345
const origin = new URL(secureUrl).origin;
346346
const ajaxUrl = `${origin}/ajax-module-connector.php`;
347-
347+
348348
const ajaxHeaders = {
349349
'User-Agent': 'Mozilla/5.0',
350350
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
@@ -401,7 +401,7 @@ async function runCrawler() {
401401
parsed.forEach(v => existingMap.set(`${v.wiki}:${v.page}`, v));
402402
}
403403
}
404-
404+
405405
newVotes.forEach(nv => {
406406
const id = `${nv.wiki}:${nv.page}`;
407407
if (!existingMap.has(id)) existingMap.set(id, nv);
@@ -418,7 +418,7 @@ async function runCrawler() {
418418
create: { key, value: JSON.stringify(truncatedVotes) }
419419
});
420420
}
421-
userVotesMap = {};
421+
userVotesMap = {};
422422
}
423423
await sleep(2500);
424424
}

‎content/about.md‎

Lines changed: 15 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
# 关于 WikitDB
22

3-
WikitDB 是一个 **面向 Wikidot 社区生态的非营利性同人项目**,致力于把散落在各个分站的页面、作者、评分、论坛数据串联起来,为读者和作者提供统一的检索、追踪与分析体验。
3+
**WikitDB** 是面向 Wikidot 社区生态的开源项目,基于 **Wikit API** 的数据接口,致力于把散落在各个 Wikidot 站点的页面、作者、评分、论坛数据串联起来,为读者和作者提供统一的检索、追踪与分析体验。
44

5-
本站由 Laimu_slime 主持开发,在 lestday233 奠定的经典架构基础上进行了全面的底层重构与视觉升级;LOGO 由 bairan317 倾力制作;核心数据接口由 **Wikit API** 提供强力支撑。
5+
**WikitDB** 企划最初由 lestday233 提出,由 Laimu_slime 主持开发和架构,由 OxygenNine 进行全面的视觉升级;数据接口由 **Wikit API** 提供强力支持。
66

77
---
88

99
## 核心能力
1010

1111
### 页面归档
12-
- 实时同步来自 Wikit API 的各分站页面元数据
13-
- 支持按站点、标签、评分区间、发布时间多维筛选
14-
- 保留已从原站点地图消失的历史页面(`--keep-removed`)
12+
- 自动同步来自 Wikit API 的各分站页面元数据
13+
- 支持按站点、标签、评分区间、发布时间等多要素筛选数据
14+
- 通过增量更新,保留已从原站点移除的页面(`--keep-removed`)
1515

1616
### 作者追踪
1717
- 收录作者在不同分站的创作与评分走势
@@ -24,23 +24,11 @@ WikitDB 是一个 **面向 Wikidot 社区生态的非营利性同人项目**,
2424

2525
### 论坛同步
2626
- 支持已接入分站的论坛帖子索引与搜索
27-
- 保留 authorId / threadId / parentId 关系,可还原完整回帖树
27+
- 保留并还原完整的帖楼数据
2828

29-
### 实用工具集
30-
- 盲盒抽取、删除公告生成、质量评审
31-
- 奖励发放、交易市场、会员自助申请等社区常用工具
32-
- 管理员专属:Wikit 备份管理工具
33-
34-
---
35-
36-
## 我们的理念
37-
38-
> **连接创作与未来的纽带**
39-
40-
- **非营利**:无广告、无付费墙,所有功能免费开放
41-
- **社区驱动**:围绕 Wikidot 社区生态设计,优先服务作者与读者
42-
- **隐私友好**:不索要不必要的个人信息;短信验证仅用于防机器人注册,不与第三方共享
43-
- **开放透明**:代码开源在 GitHub,所有架构决策可被社区审视与贡献
29+
### 多样工具
30+
- 盲盒抽取、交易市场、战力雷达等娱乐玩法
31+
- FTML编辑器、代发页面、删帖公示等实用工具集
4432

4533
---
4634

@@ -59,23 +47,7 @@ WikitDB 是一个 **面向 Wikidot 社区生态的非营利性同人项目**,
5947
| SCP 基金会 Minecraft 分部 | scp-wiki-mc | SCP + MC 融合 |
6048
| The Backrooms 中文维基 | brcn | Backrooms 主分社区 |
6149

62-
> 如需申请收录更多站点,请通过社区渠道联系管理员。
63-
64-
---
65-
66-
## 常见问题
67-
68-
**Q: 使用 WikitDB 需要账号吗?**
69-
大部分检索与浏览功能无需登录。作者追踪、虚拟股市、高级搜索等与账户绑定的数据功能需要注册账号。注册免费,花不了一分钟。
70-
71-
**Q: 数据多久更新一次?**
72-
备份任务每天 12:00(Asia/Shanghai)自动执行;Wikit API 侧的实时接口会尽可能快地反映 Wikidot 平台上的最新内容。
73-
74-
**Q: 我的文章被收录进来了,但不希望这样**
75-
请通过社区渠道联系管理员,我们会在核验身份后对特定条目进行遮蔽。WikitDB 本质是为读者服务的索引工具,不替代原站点的权威发布。
76-
77-
**Q: 为什么要邮箱验证?**
78-
仅用于防机器人刷号,避免虚拟股市和论坛同步工具被恶意滥用。邮箱验证记录不会与任何第三方共享。
50+
> 如需申请收录更多站点,请联系 WikitDB 团队职员。
7951
8052
---
8153

@@ -89,16 +61,10 @@ WikitDB 是一个 **面向 Wikidot 社区生态的非营利性同人项目**,
8961

9062
---
9163

92-
## 致谢
64+
## 开发团队
9365

94-
- **Laimu_slime** — 主要贡献者/维护者
95-
- **lestday233** — 初版 WikitDB 创始人
96-
- **白然** — WikitDB LOGO 设计师
9766
- **Kakushi** - Wikit创始人,Wikit API运维
98-
- **UMOU** - 贡献者
99-
- **OxygenNine** - ui-redesign
100-
- 每一位为 Wikidot 社区贡献原创内容的创作者
101-
102-
---
103-
104-
*WikitDB Since 2026 · WikitDB Team*
67+
- **Laimu_slime** — 主要开发者/维护者
68+
- **lestday233** — 概念提出者/初步构建者
69+
- **umou** — 项目贡献者/测试站运维
70+
- **OxygenNine** - UI-redesign

‎package.json‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,11 @@
5656
},
5757
"engines": {
5858
"node": ">=18.0.0"
59+
},
60+
"allowScripts": {
61+
"@prisma/client@6.19.3": true,
62+
"@prisma/engines@6.19.3": true,
63+
"prisma@6.19.3": true,
64+
"unrs-resolver@1.12.2": true
5965
}
6066
}

‎pages/index.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const faqs = [
4444
},
4545
{
4646
q: '数据来源是什么?更新及时吗?',
47-
a: '数据来自 Wikit API,由其调用 kakushi-w/wikit CLI 定期抓取 Wikidot 平台公开页面。每天 12:00(Asia/Shanghai)自动执行备份任务,接口层面会尽可能快地反映最新内容。'
47+
a: '数据来自 Wikit API,由其调用 kakushi-w/Wikit CLI工具定期抓取 Wikidot 平台公开页面。每天 12:00(Asia/Shanghai)自动执行备份任务,接口层面会尽可能快地反映最新内容。'
4848
},
4949
{
5050
q: '我是作者,不希望我的作品被收录?',
@@ -498,7 +498,7 @@ const Home = () => {
498498
注册一下?
499499
</h2>
500500
<p className="mx-auto mt-5 max-w-[520px] text-base leading-[1.9] text-zinc-200">
501-
有账号才能用作者评分、动态追踪、高级搜索这些功能。免费的,花不了一分钟。
501+
有账号才能使用作者评分、动态追踪、高级搜索这些功能,快速注册你的 WikitDB 账号。
502502
</p>
503503
<div className="mt-10 flex flex-wrap items-center justify-center gap-3">
504504
<Link
@@ -517,7 +517,7 @@ const Home = () => {
517517
</div>
518518
<p className="mt-6 text-xs tracking-wide text-primary-300">
519519
<i aria-hidden="true" className="fa-solid fa-lock mr-1" />
520-
仅需Wikidot验证防机器人,不与第三方共享
520+
需验证并绑定你的Wikidot账号
521521
</p>
522522
</div>
523523
</section>

‎pages/login.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React, { useState } from 'react';
22
import Head from 'next/head';
33
import { useRouter } from 'next/router';
4+
const config = require('../wikitdb.config.js');
45

56
export default function Login() {
67
const router = useRouter();
@@ -61,7 +62,7 @@ if (res.ok) {
6162
</Head>
6263

6364
<div className="bg-white dark:bg-zinc-800 p-8 rounded-xl border border-zinc-200 dark:border-zinc-700 w-full max-w-md shadow-xl transition-colors duration-300">
64-
<h1 className="text-2xl font-bold text-zinc-900 dark:text-white mb-6 text-center">登录账号</h1>
65+
<h1 className="text-2xl font-bold text-zinc-900 dark:text-white mb-6 text-center">登录 {config.SITE_NAME}</h1>
6566

6667
{message && (
6768
<div className="mb-4 p-3 rounded bg-zinc-100 dark:bg-zinc-700/50 text-zinc-600 dark:text-zinc-300 text-sm text-center border border-zinc-200 dark:border-zinc-600">

‎pages/register.js‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export default function Register() {
7272
setSuccess('');
7373

7474
if (!username || !password || !email || !code) {
75-
setError('请完整填写所有信息(含邮箱和验证码)');
75+
setError('请完整填写全部信息(含邮箱和验证码)');
7676
return;
7777
}
7878
if (password !== confirmPassword) {
@@ -167,8 +167,8 @@ export default function Register() {
167167
<div className="absolute top-0 right-0 w-32 h-32 bg-accent-soft rounded-full blur-3xl pointer-events-none"></div>
168168

169169
<div className="text-center mb-8 relative z-10">
170-
<h1 className="text-3xl font-bold text-fg mb-2">加入 {config.SITE_NAME}</h1>
171-
<p className="text-fg-2 text-sm font-medium tracking-tight uppercase tracking-widest opacity-80">初始化你的数字档案身份</p>
170+
<h1 className="text-3xl font-bold text-fg mb-2">注册 {config.SITE_NAME}</h1>
171+
<p className="text-fg-2 text-sm font-medium tracking-tight uppercase tracking-widest opacity-80">快速创建你的 {config.SITE_NAME} 账号</p>
172172
</div>
173173

174174
{error && (
@@ -191,7 +191,7 @@ export default function Register() {
191191
value={username}
192192
onChange={(e) => setUsername(e.target.value)}
193193
className="w-full bg-sunken border border-line rounded-xl px-4 py-3 text-fg focus:outline-none focus:border-accent-line transition-all shadow-inner"
194-
placeholder="推荐使用您的常用代号"
194+
placeholder="推荐使用你的常用代号"
195195
/>
196196
</div>
197197
<div>
@@ -263,7 +263,7 @@ export default function Register() {
263263

264264
<div className="mt-6 text-center">
265265
<p className="text-fg-3 text-xs">
266-
已有档案记录? <Link href="/login" className="text-accent font-bold hover:underline ml-1 tracking-tight">立即接入终端</Link>
266+
已有账号? <Link href="/login" className="text-accent font-bold hover:underline ml-1 tracking-tight">立即登录</Link>
267267
</p>
268268
</div>
269269
</form>
@@ -316,7 +316,7 @@ export default function Register() {
316316
<i className="fa-solid fa-circle-check"></i>
317317
</div>
318318
<h3 className="text-xl font-bold text-fg mb-2 tracking-tight">身份识别成功</h3>
319-
<p className="text-fg-2 text-sm mb-8 leading-relaxed">我们已在 Wikit 验证记录中确认了您的身份,邮箱验证也已就绪。</p>
319+
<p className="text-fg-2 text-sm mb-8 leading-relaxed">我们已在 Wikit 验证记录中确认了你的身份,邮箱验证也已就绪。</p>
320320

321321
<div className="bg-panel p-5 rounded-2xl border border-line shadow-sm">
322322
<span className="text-[10px] text-fg-3 font-bold uppercase tracking-widest block mb-2">绑定的 Wikidot 身份</span>
@@ -336,7 +336,7 @@ export default function Register() {
336336
disabled={isVerifying}
337337
className="flex-1 bg-accent-solid hover:bg-accent-solid-hover text-accent-fg font-black py-4 rounded-xl transition-all shadow-xl shadow-violet-500/20 text-xs uppercase tracking-[0.2em] disabled:opacity-50"
338338
>
339-
{isVerifying ? '正在建立档案...' : '确认绑定并注册'}
339+
{isVerifying ? '正在创建...' : '确认绑定并注册'}
340340
</button>
341341
</div>
342342
</div>

‎tsconfig.json‎

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
{
22
"compilerOptions": {
33
"target": "ES2020",
4-
"lib": ["dom", "dom.iterable", "esnext"],
4+
"lib": [
5+
"dom",
6+
"dom.iterable",
7+
"esnext"
8+
],
59
"allowJs": true,
610
"skipLibCheck": true,
711
"strict": true,
@@ -13,13 +17,20 @@
1317
"isolatedModules": true,
1418
"jsx": "preserve",
1519
"incremental": true,
16-
"plugins": [{ "name": "next" }]
20+
"plugins": [
21+
{
22+
"name": "next"
23+
}
24+
]
1725
},
1826
"include": [
1927
"next-env.d.ts",
2028
"**/*.ts",
2129
"**/*.tsx",
2230
".next/types/**/*.ts"
2331
],
24-
"exclude": ["node_modules", "others"]
25-
}
32+
"exclude": [
33+
"node_modules",
34+
"others"
35+
]
36+
}

‎wikitdb.config.js‎

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,19 @@ module.exports = {
44
SITE_SINCE: '2026',
55
SITE_AUTHOR: 'WikitDB Team',
66
SUPPORT_WIKI: [
7-
/*站点格式
7+
8+
/*站点格式
9+
{
10+
NAME: "站点名称",
11+
URL: "站点链接",
12+
ImgURL: "Logo链接",
13+
PARAM: "简写",
14+
WIKIT_ID: "Wikit站点里写的站点名称,这里用于筛选作者的站点页面",
15+
GQL_API: "可选,自定义GraphQL端点,不填则默认 https://wikit.unitreaty.org/apiv1/graphql"
16+
},
17+
*/
18+
819
{
9-
NAME: "站点名称",
10-
URL: "站点链接",
11-
ImgURL: "Logo链接",
12-
PARAM: "简写",
13-
WIKIT_ID: "Wikit站点里写的站点名称,这里用于筛选作者的站点页面",
14-
GQL_API: "可选,自定义GraphQL端点,不填则默认 https://wikit.unitreaty.org/apiv1/graphql"
15-
},
16-
*/
17-
{
1820
NAME: "深林文学部",
1921
URL: "https://deep-forest-club.wikidot.com/",
2022
ImgURL: "https://deep-forest-club.wdfiles.com/local--files/component%3Atheme/logo.png",
@@ -25,7 +27,7 @@ module.exports = {
2527
{
2628
NAME: "后室IF分站",
2729
URL: "https://if-backrooms.wikidot.com/",
28-
ImgURL: "https://laimu.backroomswiki.top/img/Logo.png",
30+
ImgURL: "https://if-backrooms.wdfiles.com/local--files/start/Logo",
2931
PARAM: "if",
3032
WIKIT_ID: "if-backrooms",
3133
AUTHOR_TAG: "作者"

0 commit comments

Comments
 (0)