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