vault backup: 2026-11-09 09:18:58
This commit is contained in:
1 parent
856d0203da
commit
75072389db
42 files changed
+5994
-37
No files matched your search
@@ -0,0 +1,18 @@
|
||||
// 解析单篇数据列表
|
||||
import fs from 'node:fs';
|
||||
|
||||
const cap = JSON.parse(fs.readFileSync('out/single-capture.json', 'utf8'));
|
||||
const target = cap.find(c => c.url.includes('articleListStatistic'));
|
||||
if (!target) { console.log('NO_TARGET'); process.exit(1); }
|
||||
|
||||
const j = JSON.parse(target.body);
|
||||
fs.writeFileSync('out/single-parsed.json', JSON.stringify(j, null, 2), 'utf8');
|
||||
|
||||
const d = j.data || {};
|
||||
console.log('KEYS=' + Object.keys(d).join(','));
|
||||
const list = d.list || d.items || d.article_list || [];
|
||||
console.log('LIST_LEN=' + list.length);
|
||||
if (list.length) {
|
||||
console.log('SAMPLE_KEYS=' + Object.keys(list[0]).join(','));
|
||||
console.log(JSON.stringify(list[0], null, 2).slice(0, 2500));
|
||||
}
|
||||
Reference in new issue
Block a user