rss: remove konachan and yande.re post
This commit is contained in:
parent
a7e2d6e235
commit
ee51eada51
|
|
@ -146,10 +146,8 @@ RSSHub 是一个轻量、易于扩展的 RSS 生成器,可以给任何奇奇
|
|||
- Trending
|
||||
- Issue
|
||||
- Konachan.com Anime Wallpapers
|
||||
- posts
|
||||
- Popular Recent Posts
|
||||
- yande.re
|
||||
- posts
|
||||
- Popular Recent Posts
|
||||
- 纽约时报
|
||||
- 新闻早报
|
||||
|
|
|
|||
|
|
@ -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 <Author uid="hufan-akari"/>
|
||||
|
||||
路由:
|
||||
|
||||
- `/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 <Author uid="hufan-akari"/>
|
||||
|
||||
路由:
|
||||
|
|
@ -1191,19 +1179,11 @@ key: 产品密钥
|
|||
|
||||
## yande.re
|
||||
|
||||
### Posts <Author uid="hufan-akari"/>
|
||||
::: 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 <Author uid="hufan-akari"/>
|
||||
|
||||
|
|
|
|||
|
|
@ -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'));
|
||||
|
||||
// 纽约时报
|
||||
|
|
|
|||
|
|
@ -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 = `<img referrerpolicy="no-referrer" src="${url}" />`;
|
||||
if (post.source) {
|
||||
result += `<a href="${post.source}">source</a>`;
|
||||
}
|
||||
if (post.parent_id) {
|
||||
result += `<a href="${baseURL}/post/show/${post.parent_id}">parent</a>`;
|
||||
}
|
||||
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+/),
|
||||
};
|
||||
}),
|
||||
};
|
||||
};
|
||||
|
|
@ -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 = `<img referrerpolicy="no-referrer" src="${url}" />`;
|
||||
if (post.source) {
|
||||
result += `<a href="${post.source}">source</a>`;
|
||||
}
|
||||
if (post.parent_id) {
|
||||
result += `<a href="https://yande.re/post/show/${post.parent_id}">parent</a>`;
|
||||
}
|
||||
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+/),
|
||||
};
|
||||
}),
|
||||
};
|
||||
};
|
||||
Loading…
Reference in New Issue