ks-recollect-targeted.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!/usr/bin/env node
  2. const { collectKs, collectHotList, mergeAll } = require('./ks-collect');
  3. const TARGET_KEYWORDS = [
  4. { kw: '黑中介', videos: 20, commentPages: 2, hypotheses: ['H6', 'H4'] },
  5. { kw: '入职被坑', videos: 20, commentPages: 2, hypotheses: ['H6', 'H8'] },
  6. { kw: '押金不退', videos: 20, commentPages: 2, hypotheses: ['H6', 'H8'] },
  7. { kw: '工资日结', videos: 20, commentPages: 2, hypotheses: ['H2', 'H3'] },
  8. { kw: '当天入职', videos: 20, commentPages: 2, hypotheses: ['H3', 'H4'] },
  9. { kw: '真实薪资', videos: 20, commentPages: 2, hypotheses: ['H2', 'H5'] },
  10. { kw: '工作环境真实', videos: 20, commentPages: 2, hypotheses: ['H7', 'H5'] },
  11. { kw: '快手求职', videos: 20, commentPages: 2, hypotheses: ['H1', 'H8'] },
  12. { kw: '工厂打工', videos: 20, commentPages: 2, hypotheses: ['H1', 'H3', 'H7'] },
  13. ];
  14. const TARGET_HOTLISTS = [
  15. { id: 'hotShare', name: '热门', hypotheses: ['H1', 'H5', 'H8'] },
  16. { id: 'job', name: '职场', hypotheses: ['H1', 'H2', 'H4', 'H6'] },
  17. { id: 'recruit', name: '招聘', hypotheses: ['H1', 'H3', 'H4'] },
  18. ];
  19. async function main() {
  20. const args = new Set(process.argv.slice(2));
  21. const includeHotlist = args.has('--hotlist');
  22. const skipMerge = args.has('--no-merge');
  23. for (const task of TARGET_KEYWORDS) {
  24. await collectKs(task, { force: true });
  25. }
  26. if (includeHotlist) {
  27. for (const task of TARGET_HOTLISTS) {
  28. await collectHotList(task, { force: true });
  29. }
  30. }
  31. if (!skipMerge) mergeAll();
  32. }
  33. main().catch((error) => {
  34. console.error(error);
  35. process.exit(1);
  36. });