Files
RSSHub/lib/routes/bjnews/utils.ts
T
AndvariandTony 4c3ab5c631 fix(route/bjnews): Update to new standard (#16249)
* fix(route/bjnews): Update to new standard

* .

* .

* Add column

* Update lib/routes/bjnews/cat.ts

Co-authored-by: Tony <TonyRL@users.noreply.github.com>

* Update column.ts

---------
2024-07-27 22:45:38 +08:00

20 lines
671 B
TypeScript

import cache from '@/utils/cache';
import { parseDate } from '@/utils/parse-date';
import timezone from '@/utils/timezone';
import ofetch from '@/utils/ofetch';
import { load } from 'cheerio';
export function fetchArticle(item) {
return cache.tryGet(item.link, async () => {
const responses = await ofetch(item.link);
const $d = load(responses);
// $d('img').each((i, e) => $(e).attr('referrerpolicy', 'no-referrer'));
item.pubDate = timezone(parseDate($d('.left-info .timer').text()), +8);
item.author = $d('.left-info .reporter').text();
item.description = $d('#contentStr').html();
return item;
});
}