Files
RSSHub/lib/routes/tencent/qcloud/mlvb/changelog.js
Sukka d82847f541 style/chore(eslint): enforce new rules (#8040)
* style: prefer object shorthand syntax
* refactor: prefer Array#map over Array#forEach
* style: prefer arrow callback
* chore(eslint): update rules
* style: auto fix by eslint
2021-08-17 22:23:23 +08:00

29 lines
735 B
JavaScript

const got = require('@/utils/got');
const cheerio = require('cheerio');
module.exports = async (ctx) => {
const url = 'https://cloud.tencent.com/document/product/454/7878';
const res = await got({
method: 'get',
url,
});
const $ = cheerio.load(res.data);
const resultItem = [];
$('.J-mainDetail #docArticleContent h3').each(function () {
const item = {};
item.title = $(this).text();
item.description = $(this).nextUntil('h3').text();
item.link = url;
item.guid = $(this).text();
resultItem.push(item);
});
ctx.state.data = {
title: '腾讯移动直播 SDK 更新日志',
link: url,
item: resultItem,
};
};