feat(route): add 便宜VPS网 (#14740)

* add 便宜VPS网

* Update rss.ts

---------

Co-authored-by: pull[bot] <39814207+pull[bot]@users.noreply.github.com>
This commit is contained in:
cnkmmk
2024-03-17 01:23:11 +08:00
committed by GitHub
co-authored by pull[bot]
parent 3b37bbd177
commit c209a7c419
2 changed files with 38 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
import type { Namespace } from '@/types';
export const namespace: Namespace = {
name: '便宜VPS网',
url: 'pianyivps.com',
};
+32
View File
@@ -0,0 +1,32 @@
import { Route } from '@/types';
import { parseDate } from '@/utils/parse-date';
import got from '@/utils/got';
export const route: Route = {
path: '/',
categories: ['blog'],
radar: [{
source: ['pianyivps.com/'],
}],
name: '最新发布',
maintainers: ['cnkmmk'],
handler,
url: 'pianyivps.com/',
};
async function handler() {
const url = 'https://www.pianyivps.com';
const response = await got(`${url}/wp-json/wp/v2/posts`);
const list = response.data;
return {
title: '便宜VPS网',
link: url,
description: '便宜VPS网 - 最新发布',
item: list.map((item) => ({
title: item.title.rendered,
link: item.link,
pubDate: parseDate(item.date_gmt),
description: item.content.rendered,
})),
};
}