Skip to content

Commit

Permalink
feat(route): add route of Oct的小破站 (DIYgod#16809)
Browse files Browse the repository at this point in the history
* Add oct0pu5.cn

* feat(toute): add route of Oct0pu5的小破站

* fix: use parseDate() instead of Data.parse()

* fix: use Date.parse

---------

Co-authored-by: Oct0pu5 <2379401911@qq.com>
  • Loading branch information
wiketool and Octopus058 authored Sep 20, 2024
1 parent 62d7283 commit 9ddfd26
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/routes/oct0pu5/namespace.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import type { Namespace } from '@/types';

export const namespace: Namespace = {
name: 'Oct0pu5 blog',
url: 'Oct0pu5.cn',

zh: {
name: 'Oct0pu5的小破站',
},
};
48 changes: 48 additions & 0 deletions lib/routes/oct0pu5/rss.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import { Route } from '@/types';
import buildData from '@/utils/common-config';

const baseUrl = 'https://oct0pu5.cn/';

export const route: Route = {
path: '/',
categories: ['blog'],
example: '/oct0pu5',
features: {
requireConfig: false,
requirePuppeteer: false,
antiCrawler: false,
supportBT: false,
supportPodcast: false,
supportScihub: false,
},
radar: [
{
source: ['oct0pu5.cn'],
target: '/',
},
],
name: 'Oct的小破站',
maintainers: ['octopus058', 'wiketool'],
handler,
};

async function handler() {
const link = baseUrl;
return await buildData({
link,
url: link,
title: `%title%`,
description: `%description%`,
params: {
title: '博客',
description: 'Oct0pu5的博客',
},
item: {
item: '.recent-posts > .recent-post-item',
title: `$('.recent-post-info > a').text()`,
link: `$('.recent-post-info > a').attr('href')`,
description: `$('.recent-post-info > .content').text()`,
pubDate: `Date.parse($('div.recent-post-info > div.article-meta-wrap > span.post-meta-date > time').text().trim())`,
},
});
}

0 comments on commit 9ddfd26

Please sign in to comment.