mefcl
类型
社交媒体
网站地址
https://www.mefcl.com
网站描述
分享纯净好资源
需要生成什么内容?
const got = require('@/utils/got'); const cheerio = require('cheerio'); const { parseDate } = require('@/utils/parse-date');
async function getArticles() { const url = 'https://www.mefcl.com'; const { data: res } = await got(url); const $ = cheerio.load(res); const articles = $('section.content').eq(1).find('article'); return articles.toArray().map((elem) => { const a = $(elem).find('header > a'); return { title: a.find('h2').text(), description: a.find('p clsss="note"').text(), link: a.attr('href'), pubDate: parseDate($(elem).find('meta').find('time').attr('time')), category: $(elem) .find('article header p') .toArray() .map((elem) => $(elem).text()), }; }); }
module.exports = async (ctx) => { const articles = await getArticles(); ctx.state.data = { title: 'Mefcl', link: 'https://www.mefcl.com', item: articles, }; };
额外描述
No response
这不是重复的 RSS 请求
- [X] 我已经搜索了现有 issue 和 pull requests,以确保该 RSS 尚未被请求。