Files
RSSHub/lib/routes/psnine/shuzhe.ts
T
Tony a77c5f43b9 feat(route): recover psnine (#18760)
* feat: recover psnine

* fix: update path
2025-04-03 02:41:19 +08:00

44 lines
1.0 KiB
TypeScript

import type { Route } from '@/types';
import ofetch from '@/utils/ofetch';
import * as cheerio from 'cheerio';
const handler = async () => {
const url = 'https://www.psnine.com/dd';
const response = await ofetch(url);
const $ = cheerio.load(response);
const out = $('.dd_ul li')
.toArray()
.map((item) => {
const $item = $(item);
return {
title: $item.find('.dd_title').text(),
link: $item.find('.dd_title a').attr('href'),
description: $item.find('.dd_status').text(),
author: $item.find('.meta a').text(),
};
});
return {
title: $('head title').text(),
link: 'https://www.psnine.com/',
item: out,
};
};
export const route: Route = {
path: '/shuzhe',
categories: ['game'],
example: '/psnine/shuzhe',
name: '数折',
maintainers: ['betta-cyber'],
handler,
radar: [
{
source: ['psnine.com/dd', 'psnine.com'],
},
],
};