diff --git a/README.md b/README.md index 9b3669289..8b7ee4e47 100644 --- a/README.md +++ b/README.md @@ -146,10 +146,8 @@ RSSHub 是一个轻量、易于扩展的 RSS 生成器,可以给任何奇奇 - Trending - Issue - Konachan.com Anime Wallpapers - - posts - Popular Recent Posts - yande.re - - posts - Popular Recent Posts - 纽约时报 - 新闻早报 diff --git a/docs/README.md b/docs/README.md index 28fe07a43..7f1307701 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1159,22 +1159,10 @@ key: 产品密钥 - tags 可以在 [konachan](https://konachan.com/post) 选好后, 复制其 URL 中 tags= 后的参数 - 路由可选 `/konachan` 或 `/konachan.com` 或 `/konachan.net`, 其中前两者相同, `.net` 是全年龄健康的壁纸 ♡ +- 网站提供了 Posts 订阅:https://konachan.com/post/piclens?tags=[tags] ::: -### Posts - -路由: - -- `/konachan/post` -- `/konachan/post/:tags` - -举例: - -- [https://rsshub.app/konachan/post](https://rsshub.app/konachan/post) -- [https://rsshub.app/konachan/post/touhou](https://rsshub.app/konachan/post/touhou) -- [https://rsshub.app/konachan/post/panties+rating%3Asafe](https://rsshub.app/konachan/post/panties+rating%3Asafe) - ### Popular Recent Posts 路由: @@ -1191,19 +1179,11 @@ key: 产品密钥 ## yande.re -### Posts +::: tip 提示 -路由: +- 网站提供了 Posts 订阅:https://yande.re/post/piclens?tags=[tags] -- `/yande.re/post` -- `/yande.re/post/:tags` - -举例: - -- [https://rsshub.app/yande.re/post](https://rsshub.app/yande.re/post) -- [https://rsshub.app/yande.re/post/the_idolm%40ster](https://rsshub.app/yande.re/post/the_idolm%40ster) -- [https://rsshub.app/yande.re/post/kantai_collection](https://rsshub.app/yande.re/post/kantai_collection) -- [https://rsshub.app/yande.re/post/love_live%21](https://rsshub.app/yande.re/post/love_live%21) +::: ### Popular Recent Posts diff --git a/router.js b/router.js index dfa469650..6b106cf6a 100755 --- a/router.js +++ b/router.js @@ -267,23 +267,15 @@ router.get('/github/trending/:since/:language?', require('./routes/github/trendi router.get('/github/issue/:user/:repo', require('./routes/github/issue')); // konachan -router.get('/konachan/post', require('./routes/konachan/post')); -router.get('/konachan.com/post', require('./routes/konachan/post')); -router.get('/konachan.net/post', require('./routes/konachan/post')); router.get('/konachan/post/popular_recent', require('./routes/konachan/post_popular_recent')); router.get('/konachan.com/post/popular_recent', require('./routes/konachan/post_popular_recent')); router.get('/konachan.net/post/popular_recent', require('./routes/konachan/post_popular_recent')); -router.get('/konachan/post/:tags', require('./routes/konachan/post')); -router.get('/konachan.com/post/:tags', require('./routes/konachan/post')); -router.get('/konachan.net/post/:tags', require('./routes/konachan/post')); router.get('/konachan/post/popular_recent/:period', require('./routes/konachan/post_popular_recent')); router.get('/konachan.com/post/popular_recent/:period', require('./routes/konachan/post_popular_recent')); router.get('/konachan.net/post/popular_recent/:period', require('./routes/konachan/post_popular_recent')); // yande.re -router.get('/yande.re/post', require('./routes/yande.re/post')); router.get('/yande.re/post/popular_recent', require('./routes/yande.re/post_popular_recent')); -router.get('/yande.re/post/:tags', require('./routes/yande.re/post')); router.get('/yande.re/post/popular_recent/:period', require('./routes/yande.re/post_popular_recent')); // 纽约时报 diff --git a/routes/konachan/post.js b/routes/konachan/post.js deleted file mode 100644 index b0bd3711d..000000000 --- a/routes/konachan/post.js +++ /dev/null @@ -1,61 +0,0 @@ -const axios = require('../../utils/axios'); -const config = require('../../config'); - -module.exports = async (ctx) => { - const { tags = '' } = ctx.params; - - const baseURL = ctx.path.startsWith('/konachan.net') ? 'https://konachan.net' : 'https://konachan.com'; - - const response = await axios({ - method: 'get', - baseURL, - url: `/post.json?tags=${tags}`, - headers: { - 'User-Agent': config.ua, - }, - }); - - const posts = response.data; - - let title = 'Konachan Anime Wallpapers'; - if (tags) { - title = decodeURIComponent(tags) + ' - ' + title; - } - - ctx.state.data = { - title, - link: `${baseURL}/post`, - item: posts.map((post) => { - const content = (url) => { - if (url.startsWith('//')) { - url = 'https:' + url; - } - let result = ``; - if (post.source) { - result += `source`; - } - if (post.parent_id) { - result += `parent`; - } - return result; - }; - - const created_at = post.created_at * 1e3; - - return { - title: post.tags, - id: `${ctx.path}#${post.id}`, - guid: `${ctx.path}#${post.id}`, - link: `${baseURL}/post/show/${post.id}`, - author: post.author, - published: new Date(created_at).toISOString(), - pubDate: new Date(created_at).toUTCString(), - description: content(post.sample_url), - summary: content(post.sample_url), - content: { html: content(post.file_url) }, - image: post.file_url, - category: post.tags.split(/\s+/), - }; - }), - }; -}; diff --git a/routes/yande.re/post.js b/routes/yande.re/post.js deleted file mode 100644 index dd0c9284f..000000000 --- a/routes/yande.re/post.js +++ /dev/null @@ -1,55 +0,0 @@ -const axios = require('../../utils/axios'); -const config = require('../../config'); - -module.exports = async (ctx) => { - const { tags = '' } = ctx.params; - - const response = await axios({ - method: 'get', - url: `https://yande.re/post.json?tags=${tags}`, - headers: { - 'User-Agent': config.ua, - }, - }); - - const posts = response.data; - - let title = 'yande.re'; - if (tags) { - title = decodeURIComponent(tags) + ' - ' + title; - } - - ctx.state.data = { - title, - link: 'https://yande.re/post', - item: posts.map((post) => { - const content = (url) => { - let result = ``; - if (post.source) { - result += `source`; - } - if (post.parent_id) { - result += `parent`; - } - return result; - }; - - const created_at = post.created_at * 1e3; - - return { - title: post.tags, - id: `${ctx.path}#${post.id}`, - guid: `${ctx.path}#${post.id}`, - link: `https://yande.re/post/show/${post.id}`, - author: post.author, - published: new Date(created_at).toISOString(), - pubDate: new Date(created_at).toUTCString(), - description: content(post.sample_url), - summary: content(post.sample_url), - content: { html: content(post.file_url) }, - image: post.file_url, - category: post.tags.split(/\s+/), - }; - }), - }; -};