From 0a049c1deddeefa5472fa0f7e44d66033627bab1 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Tue, 17 Sep 2024 16:30:18 +0800 Subject: [PATCH] docs: more popular items --- lib/routes/hpoi/all.ts | 5 +-- lib/routes/hpoi/character.ts | 5 +-- lib/routes/hpoi/work.ts | 5 +-- lib/routes/mastodon/acct.ts | 7 ++-- lib/routes/mastodon/timeline-local.ts | 5 +-- lib/routes/mastodon/timeline-remote.ts | 5 +-- lib/routes/pornhub/category.ts | 5 +-- lib/routes/pornhub/model.ts | 7 ++-- lib/routes/pornhub/pornstar.ts | 7 ++-- lib/routes/pornhub/search.ts | 5 +-- lib/routes/telegram/blog.ts | 5 +-- lib/routes/telegram/stickerpack.ts | 5 +-- lib/routes/threads/index.ts | 46 +++++++++++++++----------- lib/routes/twitch/live.ts | 5 +-- lib/routes/twitch/video.ts | 5 +-- 15 files changed, 71 insertions(+), 51 deletions(-) diff --git a/lib/routes/hpoi/all.ts b/lib/routes/hpoi/all.ts index 189adb1757ae4..05d7e91df5217 100644 --- a/lib/routes/hpoi/all.ts +++ b/lib/routes/hpoi/all.ts @@ -1,9 +1,10 @@ -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import { ProcessFeed } from './utils'; export const route: Route = { path: '/items/all/:order?', - categories: ['anime'], + categories: ['anime', 'popular'], + view: ViewType.Pictures, example: '/hpoi/items/all', parameters: { order: '排序, 见下表,默认为 add' }, features: { diff --git a/lib/routes/hpoi/character.ts b/lib/routes/hpoi/character.ts index 8dd1cfc3001ff..895b499763b33 100644 --- a/lib/routes/hpoi/character.ts +++ b/lib/routes/hpoi/character.ts @@ -1,9 +1,10 @@ -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import { ProcessFeed } from './utils'; export const route: Route = { path: '/items/character/:id/:order?', - categories: ['anime'], + categories: ['anime', 'popular'], + view: ViewType.Pictures, example: '/hpoi/items/character/1035374', parameters: { id: '角色 ID', order: '排序, 见下表,默认为 add' }, features: { diff --git a/lib/routes/hpoi/work.ts b/lib/routes/hpoi/work.ts index f30dbc3204c59..34887f5108638 100644 --- a/lib/routes/hpoi/work.ts +++ b/lib/routes/hpoi/work.ts @@ -1,9 +1,10 @@ -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import { ProcessFeed } from './utils'; export const route: Route = { path: '/items/work/:id/:order?', - categories: ['anime'], + categories: ['anime', 'popular'], + view: ViewType.Pictures, example: '/hpoi/items/work/4117491', parameters: { id: '作品 ID', order: '排序, 见下表,默认为 add' }, features: { diff --git a/lib/routes/mastodon/acct.ts b/lib/routes/mastodon/acct.ts index f5acbb3d1d742..0162fcb907447 100644 --- a/lib/routes/mastodon/acct.ts +++ b/lib/routes/mastodon/acct.ts @@ -1,10 +1,11 @@ -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import utils from './utils'; export const route: Route = { path: '/acct/:acct/statuses/:only_media?', - categories: ['social-media'], - example: '/mastodon/acct/CatWhitney@mastodon.social/statuses', + categories: ['social-media', 'popular'], + view: ViewType.SocialMedia, + example: '/mastodon/acct/Mastodon@mastodon.social/statuses', parameters: { acct: 'Webfinger account URI, like `user@host`', only_media: 'whether only display media content, default to false, any value to true' }, features: { requireConfig: false, diff --git a/lib/routes/mastodon/timeline-local.ts b/lib/routes/mastodon/timeline-local.ts index c88541cb58f0d..46f2d46d59e1c 100644 --- a/lib/routes/mastodon/timeline-local.ts +++ b/lib/routes/mastodon/timeline-local.ts @@ -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: '/timeline/:site/:only_media?', - categories: ['social-media'], + categories: ['social-media', 'popular'], + view: ViewType.SocialMedia, example: '/mastodon/timeline/pawoo.net/true', parameters: { site: 'instance address, only domain, no `http://` or `https://` protocol header', only_media: 'whether only display media content, default to false, any value to true' }, features: { diff --git a/lib/routes/mastodon/timeline-remote.ts b/lib/routes/mastodon/timeline-remote.ts index bb85812af7c69..5f55c05b5fff1 100644 --- a/lib/routes/mastodon/timeline-remote.ts +++ b/lib/routes/mastodon/timeline-remote.ts @@ -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: '/remote/:site/:only_media?', - categories: ['social-media'], + categories: ['social-media', 'popular'], + view: ViewType.SocialMedia, example: '/mastodon/remote/pawoo.net/true', parameters: { site: 'instance address, only domain, no `http://` or `https://` protocol header', only_media: 'whether only display media content, default to false, any value to true' }, features: { diff --git a/lib/routes/pornhub/category.ts b/lib/routes/pornhub/category.ts index dba121779686c..c3f8fe392a797 100644 --- a/lib/routes/pornhub/category.ts +++ b/lib/routes/pornhub/category.ts @@ -1,4 +1,4 @@ -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import cache from '@/utils/cache'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; @@ -7,7 +7,8 @@ import { config } from '@/config'; export const route: Route = { path: '/category/:caty', - categories: ['multimedia'], + categories: ['multimedia', 'popular'], + view: ViewType.Videos, example: '/pornhub/category/popular-with-women', parameters: { caty: 'category, see [categories](https://www.pornhub.com/webmasters/categories)' }, features: { diff --git a/lib/routes/pornhub/model.ts b/lib/routes/pornhub/model.ts index 9b33e073d0420..3768a8e3edf67 100644 --- a/lib/routes/pornhub/model.ts +++ b/lib/routes/pornhub/model.ts @@ -1,4 +1,4 @@ -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import got from '@/utils/got'; import { load } from 'cheerio'; import { isValidHost } from '@/utils/valid-host'; @@ -7,7 +7,8 @@ import InvalidParameterError from '@/errors/types/invalid-parameter'; export const route: Route = { path: '/model/:username/:language?/:sort?', - categories: ['multimedia'], + categories: ['multimedia', 'popular'], + view: ViewType.Videos, example: '/pornhub/model/stacy-starando', parameters: { language: 'language, see below', username: 'username, part of the url e.g. `pornhub.com/model/stacy-starando`', sort: 'sorting method, see below' }, features: { @@ -24,7 +25,7 @@ export const route: Route = { target: '/model/:username', }, ], - name: 'Verified amateur / Model', + name: 'Model', maintainers: ['I2IMk', 'queensferryme'], handler, }; diff --git a/lib/routes/pornhub/pornstar.ts b/lib/routes/pornhub/pornstar.ts index 5bbc845a9ac86..a2a6a96ed274c 100644 --- a/lib/routes/pornhub/pornstar.ts +++ b/lib/routes/pornhub/pornstar.ts @@ -1,4 +1,4 @@ -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import got from '@/utils/got'; import { load } from 'cheerio'; import { isValidHost } from '@/utils/valid-host'; @@ -7,7 +7,8 @@ import InvalidParameterError from '@/errors/types/invalid-parameter'; export const route: Route = { path: '/pornstar/:username/:language?/:sort?', - categories: ['multimedia'], + categories: ['multimedia', 'popular'], + view: ViewType.Videos, example: '/pornhub/pornstar/june-liu', parameters: { language: 'language, see below', username: 'username, part of the url e.g. `pornhub.com/pornstar/june-liu`', sort: 'sorting method, see below' }, features: { @@ -24,7 +25,7 @@ export const route: Route = { target: '/pornstar/:username', }, ], - name: 'Verified model / Pornstar', + name: 'Pornstar', maintainers: ['I2IMk', 'queensferryme'], handler, description: `**\`sort\`** diff --git a/lib/routes/pornhub/search.ts b/lib/routes/pornhub/search.ts index 07dd7bb1b3c3f..290e5010ec083 100644 --- a/lib/routes/pornhub/search.ts +++ b/lib/routes/pornhub/search.ts @@ -1,11 +1,12 @@ -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { defaultDomain, renderDescription } from './utils'; export const route: Route = { path: '/search/:keyword', - categories: ['multimedia'], + categories: ['multimedia', 'popular'], + view: ViewType.Videos, example: '/pornhub/search/stepsister', parameters: { keyword: 'keyword' }, features: { diff --git a/lib/routes/telegram/blog.ts b/lib/routes/telegram/blog.ts index 661caed28ce83..28811c4da7dec 100644 --- a/lib/routes/telegram/blog.ts +++ b/lib/routes/telegram/blog.ts @@ -1,4 +1,4 @@ -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import cache from '@/utils/cache'; import * as cheerio from 'cheerio'; import got from '@/utils/got'; @@ -6,7 +6,8 @@ import { parseDate } from '@/utils/parse-date'; export const route: Route = { path: '/blog', - categories: ['social-media'], + categories: ['social-media', 'popular'], + view: ViewType.Articles, example: '/telegram/blog', parameters: {}, features: { diff --git a/lib/routes/telegram/stickerpack.ts b/lib/routes/telegram/stickerpack.ts index cd5822117638a..dbe39ad5668bf 100644 --- a/lib/routes/telegram/stickerpack.ts +++ b/lib/routes/telegram/stickerpack.ts @@ -1,11 +1,12 @@ -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import got from '@/utils/got'; import { config } from '@/config'; import ConfigNotFoundError from '@/errors/types/config-not-found'; export const route: Route = { path: '/stickerpack/:name', - categories: ['social-media'], + categories: ['social-media', 'popular'], + view: ViewType.Pictures, example: '/telegram/stickerpack/DIYgod', parameters: { name: 'Sticker Pack name, available in the sharing URL' }, features: { diff --git a/lib/routes/threads/index.ts b/lib/routes/threads/index.ts index 3db1c6e0c9385..f9aafb7d440df 100644 --- a/lib/routes/threads/index.ts +++ b/lib/routes/threads/index.ts @@ -1,4 +1,4 @@ -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import ofetch from '@/utils/ofetch'; import { parseDate } from '@/utils/parse-date'; import { REPLIES_QUERY, THREADS_QUERY, apiUrl, threadUrl, profileUrl, extractTokens, makeHeader, getUserId, buildContent } from './utils'; @@ -8,29 +8,35 @@ import { config } from '@/config'; export const route: Route = { path: '/:user/:routeParams?', - categories: ['social-media'], + categories: ['social-media', 'popular'], + view: ViewType.SocialMedia, example: '/threads/zuck', - parameters: { user: 'Username', routeParams: 'Extra parameters, see the table below' }, - name: 'User timeline', - maintainers: ['ninboy'], - handler, - description: `Specify options (in the format of query string) in parameter \`routeParams\` to control some extra features for threads + parameters: { + user: 'Username', + routeParams: { + description: `Extra parameters, see the table below +Specify options (in the format of query string) in parameter \`routeParams\` to control some extra features for threads - | Key | Description | Accepts | Defaults to | - | ------------------------------ | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------- | ----------- | - | \`showAuthorInTitle\` | Show author name in title | \`0\`/\`1\`/\`true\`/\`false\` | \`true\` | - | \`showAuthorInDesc\` | Show author name in description (RSS body) | \`0\`/\`1\`/\`true\`/\`false\` | \`true\` | - | \`showQuotedAuthorAvatarInDesc\` | Show avatar of quoted author in description (RSS body) (Not recommended if your RSS reader extracts images from description) | \`0\`/\`1\`/\`true\`/\`false\` | \`false\` | - | \`showAuthorAvatarInDesc\` | Show avatar of author in description (RSS body) (Not recommended if your RSS reader extracts images from description) | \`0\`/\`1\`/\`true\`/\`false\` | \`falseP\` | - | \`showEmojiForQuotesAndReply\` | Use "🔁" instead of "QT", "↩️" instead of "Re" | \`0\`/\`1\`/\`true\`/\`false\` | \`true\` | - | \`showQuotedInTitle\` | Show quoted tweet in title | \`0\`/\`1\`/\`true\`/\`false\` | \`true\` | - | \`replies\` | Show replies | \`0\`/\`1\`/\`true\`/\`false\` | \`true\` | +| Key | Description | Accepts | Defaults to | +| ------------------------------ | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------- | ----------- | +| \`showAuthorInTitle\` | Show author name in title | \`0\`/\`1\`/\`true\`/\`false\` | \`true\` | +| \`showAuthorInDesc\` | Show author name in description (RSS body) | \`0\`/\`1\`/\`true\`/\`false\` | \`true\` | +| \`showQuotedAuthorAvatarInDesc\` | Show avatar of quoted author in description (RSS body) (Not recommended if your RSS reader extracts images from description) | \`0\`/\`1\`/\`true\`/\`false\` | \`false\` | +| \`showAuthorAvatarInDesc\` | Show avatar of author in description (RSS body) (Not recommended if your RSS reader extracts images from description) | \`0\`/\`1\`/\`true\`/\`false\` | \`falseP\` | +| \`showEmojiForQuotesAndReply\` | Use "🔁" instead of "QT", "↩️" instead of "Re" | \`0\`/\`1\`/\`true\`/\`false\` | \`true\` | +| \`showQuotedInTitle\` | Show quoted tweet in title | \`0\`/\`1\`/\`true\`/\`false\` | \`true\` | +| \`replies\` | Show replies | \`0\`/\`1\`/\`true\`/\`false\` | \`true\` | - Specify different option values than default values to improve readability. The URL +Specify different option values than default values to improve readability. The URL - \`\`\` - https://rsshub.app/threads/zuck/showAuthorInTitle=1&showAuthorInDesc=1&showQuotedAuthorAvatarInDesc=1&showAuthorAvatarInDesc=1&showEmojiForQuotesAndReply=1&showQuotedInTitle=1 - \`\`\``, +\`\`\` +https://rsshub.app/threads/zuck/showAuthorInTitle=1&showAuthorInDesc=1&showQuotedAuthorAvatarInDesc=1&showAuthorAvatarInDesc=1&showEmojiForQuotesAndReply=1&showQuotedInTitle=1 +\`\`\``, + }, + }, + name: 'User timeline', + maintainers: ['ninboy'], + handler, }; async function handler(ctx) { diff --git a/lib/routes/twitch/live.ts b/lib/routes/twitch/live.ts index 53edae7092fc8..ab26fa823bf8e 100644 --- a/lib/routes/twitch/live.ts +++ b/lib/routes/twitch/live.ts @@ -1,4 +1,4 @@ -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; @@ -7,7 +7,8 @@ const TWITCH_CLIENT_ID = 'kimne78kx3ncx6brgo4mv6wki5h1ko'; export const route: Route = { path: '/live/:login', - categories: ['live'], + categories: ['live', 'popular'], + view: ViewType.Notifications, example: '/twitch/live/riotgames', parameters: { login: 'Twitch username' }, features: { diff --git a/lib/routes/twitch/video.ts b/lib/routes/twitch/video.ts index 3e3ed59a8493f..1ad198cbc65da 100644 --- a/lib/routes/twitch/video.ts +++ b/lib/routes/twitch/video.ts @@ -1,5 +1,5 @@ import InvalidParameterError from '@/errors/types/invalid-parameter'; -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; @@ -14,7 +14,8 @@ const FILTER_NODE_TYPE_MAP = { export const route: Route = { path: '/video/:login/:filter?', - categories: ['live'], + categories: ['live', 'popular'], + view: ViewType.Videos, example: '/twitch/video/riotgames/highlights', parameters: { login: 'Twitch username', filter: 'Video type, Default to all' }, features: {