File size: 937 Bytes
c92aa92
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import { fetchJuejinArticle } from '../engines/juejin/fetchJuejinArticle.js';

async function testJuejinArticleFetch() {
  console.error('πŸ” Starting Juejin article fetch test...');

  try {
    const url = 'https://juejin.cn/post/7520959840199360563?searchId=20250729204924B8807908658C2F9C698D';

    console.log(`πŸ“ Fetching article from URL: ${url}`);

    const result = await fetchJuejinArticle(url);

    console.log(`πŸŽ‰ Article fetched successfully!`);
    console.log(`\nπŸ“„ Content preview (first 300 chars):`);
    console.log(`   ${result.content}`);
    console.log(`\nπŸ“Š Total content length: ${result.content.length} characters`);

    return result;
  } catch (error) {
    console.error('❌ Test failed:', error);
    if (error instanceof Error) {
      console.error(`   Error message: ${error.message}`);
    }
    return { content: '' };
  }
}

// θΏθ‘Œζ΅‹θ―•
testJuejinArticleFetch().catch(console.error);