@cloud411716/fancy-webnovel 0.1.26 → 0.1.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -219,7 +219,7 @@ async function applyScan(ctx) {
|
|
|
219
219
|
}
|
|
220
220
|
|
|
221
221
|
if (!platform || !length || !PLATFORM_TABLE.find(r => r[1] === platform)) {
|
|
222
|
-
notifyScan(session, '
|
|
222
|
+
notifyScan(session, '📋 支持的平台:\n' +
|
|
223
223
|
PLATFORM_TABLE.map(r => ` ${r[0]}. ${r[3]}(${r[2]})`).join('\n') +
|
|
224
224
|
'\n\n- 长篇:关注 追读、月票、订阅 等指标\n- 短篇:关注 传播、完读率 等指标\n- 知乎和七猫同时支持长篇和短篇');
|
|
225
225
|
|
|
@@ -129,7 +129,7 @@ async function scrapeQidian(outDir) {
|
|
|
129
129
|
const outFile = join(outDir, `${PLATFORM_CN.qidian}${rt.label}_${today}.md`);
|
|
130
130
|
const md = renderQidianMarkdown(rt.label, url, books);
|
|
131
131
|
writeFileSync(outFile, md, 'utf-8');
|
|
132
|
-
console.
|
|
132
|
+
console.error(` ✅ ${rt.label}: ${books.length} 本 → ${outFile}`);
|
|
133
133
|
results.push({ label: rt.label, count: books.length, file: outFile });
|
|
134
134
|
}
|
|
135
135
|
|
|
@@ -181,8 +181,8 @@ function scrapeBrowserStub(platform, length, outDir) {
|
|
|
181
181
|
const instructions = getBrowserInstructions(platform, length);
|
|
182
182
|
|
|
183
183
|
writeFileSync(instrFile, JSON.stringify(instructions, null, 2), 'utf-8');
|
|
184
|
-
console.
|
|
185
|
-
console.
|
|
184
|
+
console.error(` ℹ ${pcn}(${lenStr})需要 browser_* 工具,已生成指令文件:${instrFile}`);
|
|
185
|
+
console.error(` ℹ 请让 LLM 读取并执行该指令文件中的 browser 操作`);
|
|
186
186
|
return { file: instrFile, instructions };
|
|
187
187
|
}
|
|
188
188
|
|
|
@@ -315,7 +315,7 @@ function generateReport(platform, length, scanFiles, outDir) {
|
|
|
315
315
|
|
|
316
316
|
const reportFile = join(outDir, `${pcn}${lenStr}扫榜报告_${today}.md`);
|
|
317
317
|
writeFileSync(reportFile, report, 'utf-8');
|
|
318
|
-
console.
|
|
318
|
+
console.error(` ✅ 扫榜报告 → ${reportFile}`);
|
|
319
319
|
return reportFile;
|
|
320
320
|
}
|
|
321
321
|
|
|
@@ -354,7 +354,7 @@ function appendTopicDecision(platform, length, reportFile, outDir) {
|
|
|
354
354
|
const header = `# 选题决策:${today}\n\n---\n\n`;
|
|
355
355
|
writeFileSync(decisionFile, header + section + '\n', 'utf-8');
|
|
356
356
|
}
|
|
357
|
-
console.
|
|
357
|
+
console.error(` ✅ topic_decision 追加 → ${decisionFile}`);
|
|
358
358
|
return decisionFile;
|
|
359
359
|
}
|
|
360
360
|
|
|
@@ -406,7 +406,7 @@ async function main() {
|
|
|
406
406
|
|
|
407
407
|
if (platform === 'qidian') {
|
|
408
408
|
// 起点:HTTP mobile SSR
|
|
409
|
-
console.
|
|
409
|
+
console.error('→ 采集 起点(mobile SSR)...');
|
|
410
410
|
scrapeFiles = await scrapeQidian(scanDir);
|
|
411
411
|
if (!scrapeFiles.length) {
|
|
412
412
|
console.error(' ❌ 起点采集失败');
|
|
@@ -415,15 +415,15 @@ async function main() {
|
|
|
415
415
|
scanFiles = scrapeFiles.map(f => f.file);
|
|
416
416
|
} else {
|
|
417
417
|
// 其他平台:browser_* 工具(LLM 读取指令文件后执行)
|
|
418
|
-
console.
|
|
418
|
+
console.error(`→ ${PLATFORM_CN[platform]}(browser_* 工具)...`);
|
|
419
419
|
const { file, instructions } = scrapeBrowserStub(platform, length, scanDir);
|
|
420
420
|
scrapeFiles.push({ file });
|
|
421
421
|
scanFiles.push(file);
|
|
422
422
|
|
|
423
423
|
// 输出指令供 LLM 读取
|
|
424
|
-
console.
|
|
425
|
-
console.
|
|
426
|
-
console.
|
|
424
|
+
console.error('\n=== 浏览器采集指令 ===');
|
|
425
|
+
console.error(JSON.stringify(instructions, null, 2));
|
|
426
|
+
console.error('=== 浏览器采集指令 END ===\n');
|
|
427
427
|
}
|
|
428
428
|
|
|
429
429
|
// 生成扫榜报告
|
|
@@ -443,8 +443,7 @@ async function main() {
|
|
|
443
443
|
summary: `${PLATFORM_CN[platform]}(${length})采集完成,共 ${scanFiles.length} 个文件`,
|
|
444
444
|
};
|
|
445
445
|
|
|
446
|
-
console.log(
|
|
447
|
-
console.log(JSON.stringify(receipt, null, 2));
|
|
446
|
+
console.log(JSON.stringify(receipt));
|
|
448
447
|
}
|
|
449
448
|
|
|
450
449
|
main().catch(e => {
|