Skip to content

Commit

Permalink
fix(route): revise changba and add more popular routes
Browse files Browse the repository at this point in the history
  • Loading branch information
pseudoyu committed Sep 24, 2024
1 parent bd5ebcb commit 44b5b1a
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 12 deletions.
11 changes: 6 additions & 5 deletions lib/routes/changba/user.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Route } from '@/types';
import { Route, ViewType } from '@/types';
import { getCurrentPath } from '@/utils/helpers';
const __dirname = getCurrentPath(import.meta.url);

Expand All @@ -11,7 +11,8 @@ const headers = { 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Ma

export const route: Route = {
path: '/:userid',
categories: ['social-media'],
categories: ['social-media', 'popular'],
view: ViewType.Audios,
example: '/changba/skp6hhF59n48R-UpqO3izw',
parameters: { userid: '用户ID, 可在对应分享页面的 URL 中找到' },
features: {
Expand All @@ -28,7 +29,7 @@ export const route: Route = {
},
],
name: '用户',
maintainers: [],
maintainers: ['pseudoyu'],
handler,
};

Expand Down Expand Up @@ -101,9 +102,9 @@ async function handler(ctx) {
items = items.filter(Boolean);

return {
title: $('title').text(),
title: author + ' - 唱吧',
link: url,
description: $('meta[name="description"]').attr('content') || $('title').text(),
description: $('meta[name="description"]').attr('content') || author + ' - 唱吧',
item: items,
image: authorimg,
itunes_author: author,
Expand Down
8 changes: 7 additions & 1 deletion lib/routes/jike/topic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ export const route: Route = {
categories: ['social-media', 'popular'],
view: ViewType.SocialMedia,
example: '/jike/topic/556688fae4b00c57d9dd46ee',
parameters: { id: '圈子 id, 可在即刻 web 端圈子页或 APP 分享出来的圈子页 URL 中找到', showUid: '是否在内容中显示用户信息,设置为 1 则开启' },
parameters: {
id: '圈子 id, 可在即刻 web 端圈子页或 APP 分享出来的圈子页 URL 中找到',
showUid: {
description: '是否在内容中显示用户信息,设置为 1 则开启',
options: [{ value: '1', label: '显示' }],
},
},
features: {
requireConfig: false,
requirePuppeteer: false,
Expand Down
5 changes: 3 additions & 2 deletions lib/routes/misskey/featured-notes.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { Route } from '@/types';
import { Route, ViewType } from '@/types';
import got from '@/utils/got';
import utils from './utils';
import { config } from '@/config';
import ConfigNotFoundError from '@/errors/types/config-not-found';

export const route: Route = {
path: '/notes/featured/:site',
categories: ['social-media'],
categories: ['social-media', 'popular'],
view: ViewType.SocialMedia,
example: '/misskey/notes/featured/misskey.io',
parameters: { site: 'instance address, domain only, without `http://` or `https://` protocol header' },
features: {
Expand Down
5 changes: 3 additions & 2 deletions lib/routes/misskey/user-timeline.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { Route } from '@/types';
import { Route, ViewType } from '@/types';
import utils from './utils';
import { config } from '@/config';
import ConfigNotFoundError from '@/errors/types/config-not-found';
import InvalidParameterError from '@/errors/types/invalid-parameter';

export const route: Route = {
path: '/users/notes/:username',
categories: ['social-media'],
categories: ['social-media', 'popular'],
view: ViewType.SocialMedia,
example: '/misskey/users/notes/support@misskey.io',
parameters: { username: 'misskey username format, like support@misskey.io' },
features: {
Expand Down
1 change: 0 additions & 1 deletion lib/routes/pornhub/pornstar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ export const route: Route = {
},
sort: {
description: 'sorting method, leave empty for `Best`',
default: 'mr',
options: [
{
label: 'Most Recent',
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/qidian/namespace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ import type { Namespace } from '@/types';

export const namespace: Namespace = {
name: '起点',
url: 'book.qidian.com',
url: 'qidian.com',
};

0 comments on commit 44b5b1a

Please sign in to comment.