Files
RSSHub/lib/v2/v2rayshare/index.js
T
钛白andgithub-actions[bot] 7defaeac7e feat(route): add V2rayShare (#12843)
* add V2rayShare

* style: auto format

* add V2rayShare

* style: auto format

* Update docs/other.md

* Update lib/v2/v2rayshare/maintainer.js

* Update index.js

* style: auto format

* Update lib/v2/v2rayshare/index.js

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-07-22 10:52:45 +07:00

23 lines
684 B
JavaScript

const got = require('@/utils/got'); // 自订的 got
const { parseDate } = require('@/utils/parse-date');
module.exports = async (ctx) => {
const { data: response } = await got('https://v2rayshare.com/wp-json/wp/v2/posts/?per_page=10');
const items = response.map((item) => ({
title: item.title.rendered,
link: item.link,
author: 'V2rayShare',
category: ['免费节点'],
pubDate: parseDate(item.date_gmt),
description: item.content.rendered,
}));
ctx.state.data = {
title: 'V2rayShare',
link: 'https://v2rayshare.com/',
description: '免费节点分享网站',
item: items,
};
};