mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-09 06:30:40 +08:00
34 lines
1.2 KiB
JavaScript
34 lines
1.2 KiB
JavaScript
const got = require('@/utils/got');
|
|
const cheerio = require('cheerio');
|
|
|
|
module.exports = async (ctx) => {
|
|
const base = 'http://jwc.hnust.edu.cn/gzzd2_20170827120536008171/jwk3_20170827120536008171/';
|
|
const link = 'http://jwc.hnust.edu.cn/gzzd2_20170827120536008171/jwk3_20170827120536008171/index.htm';
|
|
const response = await got.get(link);
|
|
const $ = cheerio.load(response.data);
|
|
const list = $('.articleList ul li');
|
|
|
|
ctx.state.data = {
|
|
title: '湖南科技大学教务处通知',
|
|
link: link,
|
|
description: '湖南科技大学教务处通知',
|
|
item:
|
|
list &&
|
|
list
|
|
.map((index, item) => {
|
|
item = $(item);
|
|
const date = item.find('span').text();
|
|
const title = item.find('a').text();
|
|
const url = base + item.find('a').attr('href');
|
|
|
|
return {
|
|
title: title,
|
|
description: title,
|
|
pubDate: new Date(date).toUTCString(),
|
|
link: url,
|
|
};
|
|
})
|
|
.get(),
|
|
};
|
|
};
|