Files
RSSHub/lib/routes/cnki/utils.ts
T
DIYgod 83e701b592 feat: compile ts through tsdown (#18908)
* feat: build ts via tsdown

* feat: exec tsdown

* fix

* fix

* fix

* feat: use tsdown shims

* chore: run rolldown lifecycle script

* fix: use shims

---------
2025-04-22 22:29:11 +08:00

25 lines
704 B
TypeScript

import got from '@/utils/got';
import { load } from 'cheerio';
import { art } from '@/utils/render';
import path from 'node:path';
const ProcessItem = async (item) => {
const detailResponse = await got(item.link);
const $ = load(detailResponse.data);
item.description = art(path.join(__dirname, 'templates/desc.art'), {
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 };