mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-02 10:08:02 +08:00
* feat(route): add Quicker动作更新 * fix typo * delete outdated routes * fix: add h2 header * fix: invalid pubDate
37 lines
943 B
JavaScript
37 lines
943 B
JavaScript
const got = require('@/utils/got');
|
|
const cheerio = require('cheerio');
|
|
const { parseDate } = require('@/utils/parse-date');
|
|
|
|
module.exports = async (ctx) => {
|
|
const rootUrl = 'https://getquicker.net';
|
|
const currentUrl = `${rootUrl}/Help/Versions`;
|
|
|
|
const response = await got({
|
|
method: 'get',
|
|
url: currentUrl,
|
|
});
|
|
|
|
const $ = cheerio.load(response.data);
|
|
|
|
const items = $('.version')
|
|
.toArray()
|
|
.map((item) => {
|
|
item = $(item);
|
|
|
|
const a = item.find('h2 a');
|
|
|
|
return {
|
|
title: a.text().trim(),
|
|
link: `${rootUrl}${a.attr('href')}`,
|
|
description: item.find('.article-content').html(),
|
|
pubDate: parseDate(item.find('.text-secondary').first().text()),
|
|
};
|
|
});
|
|
|
|
ctx.state.data = {
|
|
title: $('title').text(),
|
|
link: currentUrl,
|
|
item: items,
|
|
};
|
|
};
|