/
mzyt.ts
48 lines (45 loc) · 1.36 KB
/
mzyt.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import { Route } from '@/types';
import got from '@/utils/got';
import { load } from 'cheerio';
import { parseDate } from '@/utils/parse-date';
const baseUrl = 'https://www.rccp.pku.edu.cn/mzyt/';
export const route: Route = {
path: '/rccp/mzyt',
categories: ['university'],
example: '/pku/rccp/mzyt',
parameters: {},
features: {
requireConfig: false,
requirePuppeteer: false,
antiCrawler: false,
supportBT: false,
supportPodcast: false,
supportScihub: false,
},
radar: [
{
source: ['www.rccp.pku.edu.cn/'],
},
],
name: '每周一推 - 中国政治学研究中心',
maintainers: ['vhxubo'],
handler,
url: 'www.rccp.pku.edu.cn/',
};
async function handler() {
const response = await got(baseUrl);
const $ = load(response.data);
return {
title: '每周一推 - 北京大学中国政治学研究中心',
link: baseUrl,
description: $('meta[name="description"]').attr('content'),
item: $('li.list')
.map((index, item) => ({
title: $(item).find('a').text().trim(),
description: '',
pubDate: parseDate($(item).find('span').first().text(), '[YYYY-MM-DD]'),
link: baseUrl + $(item).find('a').attr('href'),
}))
.get(),
};
}