Skip to content

Commit

Permalink
docs: more popular items
Browse files Browse the repository at this point in the history
  • Loading branch information
DIYgod committed Sep 17, 2024
1 parent 1108e0c commit 0a049c1
Show file tree
Hide file tree
Showing 15 changed files with 71 additions and 51 deletions.
5 changes: 3 additions & 2 deletions lib/routes/hpoi/all.ts
Original file line number Diff line number Diff line change
@@ -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: {
Expand Down
5 changes: 3 additions & 2 deletions lib/routes/hpoi/character.ts
Original file line number Diff line number Diff line change
@@ -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: {
Expand Down
5 changes: 3 additions & 2 deletions lib/routes/hpoi/work.ts
Original file line number Diff line number Diff line change
@@ -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: {
Expand Down
7 changes: 4 additions & 3 deletions lib/routes/mastodon/acct.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
5 changes: 3 additions & 2 deletions lib/routes/mastodon/timeline-local.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: '/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: {
Expand Down
5 changes: 3 additions & 2 deletions lib/routes/mastodon/timeline-remote.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: '/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: {
Expand Down
5 changes: 3 additions & 2 deletions lib/routes/pornhub/category.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 cache from '@/utils/cache';
import got from '@/utils/got';
import { parseDate } from '@/utils/parse-date';
Expand All @@ -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: {
Expand Down
7 changes: 4 additions & 3 deletions lib/routes/pornhub/model.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 got from '@/utils/got';
import { load } from 'cheerio';
import { isValidHost } from '@/utils/valid-host';
Expand All @@ -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: {
Expand All @@ -24,7 +25,7 @@ export const route: Route = {
target: '/model/:username',
},
],
name: 'Verified amateur / Model',
name: 'Model',
maintainers: ['I2IMk', 'queensferryme'],
handler,
};
Expand Down
7 changes: 4 additions & 3 deletions lib/routes/pornhub/pornstar.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 got from '@/utils/got';
import { load } from 'cheerio';
import { isValidHost } from '@/utils/valid-host';
Expand All @@ -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: {
Expand All @@ -24,7 +25,7 @@ export const route: Route = {
target: '/pornstar/:username',
},
],
name: 'Verified model / Pornstar',
name: 'Pornstar',
maintainers: ['I2IMk', 'queensferryme'],
handler,
description: `**\`sort\`**
Expand Down
5 changes: 3 additions & 2 deletions lib/routes/pornhub/search.ts
Original file line number Diff line number Diff line change
@@ -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: {
Expand Down
5 changes: 3 additions & 2 deletions lib/routes/telegram/blog.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 cache from '@/utils/cache';
import * as cheerio from 'cheerio';
import got from '@/utils/got';
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: {
Expand Down
5 changes: 3 additions & 2 deletions lib/routes/telegram/stickerpack.ts
Original file line number Diff line number Diff line change
@@ -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: {
Expand Down
46 changes: 26 additions & 20 deletions lib/routes/threads/index.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 ofetch from '@/utils/ofetch';
import { parseDate } from '@/utils/parse-date';
import { REPLIES_QUERY, THREADS_QUERY, apiUrl, threadUrl, profileUrl, extractTokens, makeHeader, getUserId, buildContent } from './utils';
Expand All @@ -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) {
Expand Down
5 changes: 3 additions & 2 deletions lib/routes/twitch/live.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 got from '@/utils/got';
import { parseDate } from '@/utils/parse-date';

Expand All @@ -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: {
Expand Down
5 changes: 3 additions & 2 deletions lib/routes/twitch/video.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand All @@ -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: {
Expand Down

0 comments on commit 0a049c1

Please sign in to comment.