Files
RSSHub/lib/routes/p-articles/utils.ts
T
Tony b84bb92a8a style: replace unicorn/no-for-loop w/ typescript/prefer-for-of (#20798)
* style: replace unicorn/no-for-loop w/ typescript/prefer-for-of

* style: fix typescript-eslint/prefer-for-of

* style: fix typescript/no-inferrable-types

* style: fix typescript-eslint/consistent-generic-constructors

* style: typescript-eslint/consistent-type-assertions

* style: fix typescript-eslint/array-type

* fix: revert .entries() in d96ca62d3d80806b0475a54e749decfc07b24701
2026-01-02 09:42:24 +08:00

23 lines
648 B
TypeScript

import { load } from 'cheerio';
import { parseDate } from '@/utils/parse-date';
import timezone from '@/utils/timezone';
const rootUrl = 'https://p-articles.com';
const ProcessFeed = (info, data) => {
// const $ = cheerio.load(data);
const $ = load(data);
const author = $('div.detail_title_02 > h4 > a:nth-child(2)').text().trim();
info.author = author;
const dateValue = $('div.detail_title_02 > h4 ').text().trim();
info.pubDate = timezone(parseDate(dateValue), +8);
const description = $('div.detail_contect_01').html();
info.description = description;
return info;
};
export { ProcessFeed, rootUrl };