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);
|