Files
RSSHub/lib/routes/cnki/utils.ts
T
DIYgod cf4e772de8 refactor: replace art template with jsx (#20777)
* refactor: replace art template with jsx

* fix: tsx files

* fix: renderToString import

* fix: hono html raw import

* feat: remove art
2025-12-29 12:27:32 +08:00

26 lines
662 B
TypeScript

import { load } from 'cheerio';
import got from '@/utils/got';
import { renderDescription } from './templates/desc';
const ProcessItem = async (item) => {
const detailResponse = await got(item.link);
const $ = load(detailResponse.data);
item.description = renderDescription({
author: $('h3.author > span')
.toArray()
.map((item) => $(item).text())
.join(' '),
company: $('a.author')
.toArray()
.map((item) => $(item).text())
.join(' '),
content: $('div.row > span.abstract-text').parent().text(),
});
return item;
};
export { ProcessItem };