mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-09 23:00:48 +08:00
* feat: add clash premium releases * fix date * fix: replace newline * fix: follow v2 * docs: add clash * fix: update link * fix: format * fix: lint * style: auto format * Update docs/en/program-update.md Co-authored-by: Tony <TonyRL@users.noreply.github.com> * Update lib/v2/clash/premium.js Co-authored-by: Tony <TonyRL@users.noreply.github.com> * Update lib/v2/clash/premium.js Co-authored-by: Tony <TonyRL@users.noreply.github.com> * fix: md render Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
24 lines
851 B
JavaScript
24 lines
851 B
JavaScript
const got = require('@/utils/got');
|
|
const { parseDate } = require('@/utils/parse-date');
|
|
const md = require('markdown-it')();
|
|
|
|
module.exports = async (ctx) => {
|
|
const response = await got('https://api.github.com/repos/Dreamacro/clash/releases/tags/premium');
|
|
const data = response.data;
|
|
|
|
ctx.state.data = {
|
|
title: 'Clash Premium Releases',
|
|
link: 'https://github.com/Dreamacro/clash/releases/tag/premium',
|
|
description: 'Clash Premium Releases',
|
|
item: [
|
|
{
|
|
title: data.name,
|
|
author: data.author.login,
|
|
description: md.render(data.body),
|
|
pubDate: parseDate(data.assets[0].updated_at),
|
|
link: `https://github.com/Dreamacro/clash/releases/tag/premium#${encodeURIComponent(data.name)}`,
|
|
},
|
|
],
|
|
};
|
|
};
|