Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mefcl #13446

Open
1 task done
wtronfi opened this issue Oct 1, 2023 · 0 comments
Open
1 task done

mefcl #13446

wtronfi opened this issue Oct 1, 2023 · 0 comments
Labels
RSS proposal New RSS wanted

Comments

@wtronfi
Copy link

wtronfi commented Oct 1, 2023

类型

社交媒体

网站地址

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 请求

@wtronfi wtronfi added the RSS proposal New RSS wanted label Oct 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RSS proposal New RSS wanted
Projects
None yet
Development

No branches or pull requests

1 participant