From f78ad0319e16a922f08887303cc90ce8787dafe7 Mon Sep 17 00:00:00 2001
From: Ethan Shen <42264778+nczitzk@users.noreply.github.com>
Date: Sun, 21 Aug 2022 07:43:00 +0800
Subject: [PATCH] =?UTF-8?q?feat(route):=20add=20=E4=B8=AD=E6=96=87?=
=?UTF-8?q?=E6=92=AD=E5=AE=A2=E6=A6=9C=20(#10550)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* feat(route): add 中文播客榜
* fix typo
* update docs/multimedia.md
---
docs/multimedia.md | 28 ++++++
lib/v2/xyzrank/index.js | 111 +++++++++++++++++++++++
lib/v2/xyzrank/maintainer.js | 6 ++
lib/v2/xyzrank/radar.js | 31 +++++++
lib/v2/xyzrank/router.js | 3 +
lib/v2/xyzrank/templates/description.art | 12 +++
6 files changed, 191 insertions(+)
create mode 100644 lib/v2/xyzrank/index.js
create mode 100644 lib/v2/xyzrank/maintainer.js
create mode 100644 lib/v2/xyzrank/radar.js
create mode 100644 lib/v2/xyzrank/router.js
create mode 100644 lib/v2/xyzrank/templates/description.art
diff --git a/docs/multimedia.md b/docs/multimedia.md
index 25bd0ad4e5..836e2fe9f9 100644
--- a/docs/multimedia.md
+++ b/docs/multimedia.md
@@ -1664,6 +1664,34 @@ Tiny Tiny RSS 会给所有 iframe 元素添加 `sandbox="allow-scripts"` 属性
| -- | ------ | ----- | ---- | -- | ------ |
| 留空 | bluray | 1080p | 720p | 3d | webdl |
+## 中文播客榜
+
+::: tip 提示
+
+可以通过指定 `limit` 参数确定榜单排名下限,默认为 250。
+
+若只查看榜单前 50,可在订阅 URL 后加入 `?limit=50`。
+
+即,以 [热门节目](https://xyzrank.com/#/) 为例,路由为[`/xyzrank?limit=50`](https://rsshub.app/xyzrank?limit=50)。
+
+:::
+
+### 热门节目
+
+
+
+### 热门播客
+
+
+
+### 新锐节目
+
+
+
+### 新锐播客
+
+
+
## 注视影视
### 更新通知
diff --git a/lib/v2/xyzrank/index.js b/lib/v2/xyzrank/index.js
new file mode 100644
index 0000000000..fc9baa3929
--- /dev/null
+++ b/lib/v2/xyzrank/index.js
@@ -0,0 +1,111 @@
+const got = require('@/utils/got');
+const cheerio = require('cheerio');
+const { parseDate } = require('@/utils/parse-date');
+const { art } = require('@/utils/render');
+const path = require('path');
+
+module.exports = async (ctx) => {
+ const category = ctx.params.category ?? '';
+
+ const rootUrl = 'https://xyzrank.com';
+ const currentUrl = `${rootUrl}/#/${category}`;
+
+ let response = await got({
+ method: 'get',
+ url: rootUrl,
+ });
+
+ const $ = cheerio.load(response.data);
+
+ response = await got({
+ method: 'get',
+ url: response.data.match(/