fix(route): revise changba and add more popular routes
This commit is contained in:
parent
bd5ebcbb04
commit
44b5b1a1b1
|
|
@ -1,4 +1,4 @@
|
|||
import { Route } from '@/types';
|
||||
import { Route, ViewType } from '@/types';
|
||||
import { getCurrentPath } from '@/utils/helpers';
|
||||
const __dirname = getCurrentPath(import.meta.url);
|
||||
|
||||
|
|
@ -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: {
|
||||
|
|
@ -28,7 +29,7 @@ export const route: Route = {
|
|||
},
|
||||
],
|
||||
name: '用户',
|
||||
maintainers: [],
|
||||
maintainers: ['pseudoyu'],
|
||||
handler,
|
||||
};
|
||||
|
||||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { Route } from '@/types';
|
||||
import { Route, ViewType } from '@/types';
|
||||
import got from '@/utils/got';
|
||||
import utils from './utils';
|
||||
import { config } from '@/config';
|
||||
|
|
@ -6,7 +6,8 @@ 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: {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
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';
|
||||
|
|
@ -6,7 +6,8 @@ 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: {
|
||||
|
|
|
|||
|
|
@ -34,7 +34,6 @@ export const route: Route = {
|
|||
},
|
||||
sort: {
|
||||
description: 'sorting method, leave empty for `Best`',
|
||||
default: 'mr',
|
||||
options: [
|
||||
{
|
||||
label: 'Most Recent',
|
||||
|
|
|
|||
|
|
@ -2,5 +2,5 @@ import type { Namespace } from '@/types';
|
|||
|
||||
export const namespace: Namespace = {
|
||||
name: '起点',
|
||||
url: 'book.qidian.com',
|
||||
url: 'qidian.com',
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue