diff --git a/docs/other.md b/docs/other.md index 4efa2b06b..46b89daf4 100644 --- a/docs/other.md +++ b/docs/other.md @@ -390,6 +390,16 @@ board 和 build 可在[这里](http://api.ineal.me/tss/status)查看 +## V2rayShare + +### 免费节点 + + + +获取来自 V2rayShare 的免费节点,可以通过链接复制或下载 + + + ## WeGene ### 最近更新 diff --git a/lib/v2/v2rayshare/index.js b/lib/v2/v2rayshare/index.js new file mode 100644 index 000000000..305e15ba8 --- /dev/null +++ b/lib/v2/v2rayshare/index.js @@ -0,0 +1,22 @@ +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, + }; +}; diff --git a/lib/v2/v2rayshare/maintainer.js b/lib/v2/v2rayshare/maintainer.js new file mode 100644 index 000000000..1a4bf7553 --- /dev/null +++ b/lib/v2/v2rayshare/maintainer.js @@ -0,0 +1,3 @@ +module.exports = { + '/': ['77taibai'], +}; diff --git a/lib/v2/v2rayshare/radar.js b/lib/v2/v2rayshare/radar.js new file mode 100644 index 000000000..9b76c59fc --- /dev/null +++ b/lib/v2/v2rayshare/radar.js @@ -0,0 +1,13 @@ +module.exports = { + 'v2rayshare.com': { + _name: 'V2rayShare', + '.': [ + { + title: '免费节点', + docs: 'https://docs.rsshub.app/other.html#v2rayshare', + source: ['/'], + target: '/v2rayshare', + }, + ], + }, +}; diff --git a/lib/v2/v2rayshare/router.js b/lib/v2/v2rayshare/router.js new file mode 100644 index 000000000..20c52b09d --- /dev/null +++ b/lib/v2/v2rayshare/router.js @@ -0,0 +1,3 @@ +module.exports = function (router) { + router.get('/', require('./index')); +};