Files
RSSHub/lib/routes/chikubi/index.ts
T
Tsuyumi acdbd11e93 feat(route/chikubi): refactor URL fetching and add new routes (#16758)
* refactor(route/chikubi): switch to native /feed for article URL fetching

* feat: add new routes

* refactor: remove decodeURIComponent

* fix: Handle unescaped characters in tag URLs

* chore: use '@/utils/rss-parser' instead of 'rss-parser'

* chore: update description

* feat(utils): add getPostById and getPostsByIdList for REST API content fetching

* refactor(search): use getPostsByIdList instead of processItems

* fix: Handle unescaped characters

* refactor: Separate index and navigation

* feat: optimize post fetching by id and add category & tag functions

* refactor: use api to get posts for tags and categories

* chore: directly use url

* fix: use API to fetch 'best'

* fix: destructure post object in map function

* feat: optimize getPosts function for reusability

* refactor: remove wrapper functions for getBySlug and getPostsBy
2024-09-26 01:14:26 +08:00

67 lines
1.5 KiB
TypeScript

import { Route, Data } from '@/types';
import { getPosts } from './utils';
export const route: Route = {
path: '/',
categories: ['multimedia'],
example: '/chikubi',
features: {
requireConfig: false,
requirePuppeteer: false,
antiCrawler: false,
supportBT: false,
supportPodcast: false,
supportScihub: false,
},
name: '最新記事',
maintainers: ['SnowAgar25'],
handler,
radar: [
{
title: '最新記事',
source: ['chikubi.jp/'],
target: '/',
},
{
title: '殿堂',
source: ['chikubi.jp/best-nipple-article'],
target: '/best',
},
{
title: '動畫',
source: ['chikubi.jp/nipple-video'],
target: '/video',
},
{
title: 'VR',
source: ['chikubi.jp/nipple-video-category/cat-nipple-video-vr'],
target: '/vr',
},
{
title: '漫畫',
source: ['chikubi.jp/comic'],
target: '/comic',
},
{
title: '音聲',
source: ['chikubi.jp/voice'],
target: '/voice',
},
{
title: 'CG・イラスト',
source: ['chikubi.jp/cg'],
target: '/cg',
},
],
};
async function handler(): Promise<Data> {
const items = await getPosts();
return {
title: '最新記事 - chikubi.jp',
link: 'https://chikubi.jp',
item: items,
};
}