feat: 修改豆瓣标题和参数描述 (#4315)

This commit is contained in:
Trojan Yao 2020-04-02 20:54:00 +08:00 committed by GitHub
parent 9587c74d24
commit ae200a567d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -522,7 +522,7 @@ Tiny Tiny RSS 会给所有 iframe 元素添加 `sandbox="allow-scripts"` 属性
### 豆瓣电影人
<Route author="minimalistrojan" example="/douban/celebrity/1274261" path="/douban/celebrity/:id/:sort?" :paramsDesc="['电影人 id', '排序方式,缺省为 `time` (时间排序),可为 `vote` (评价排序)']"/>
<Route author="minimalistrojan" example="/douban/celebrity/1274261" path="/douban/celebrity/:id/:sort?" :paramsDesc="['电影人 id', '排序方式,缺省为 `time`(时间排序),可为 `vote` (评价排序)']"/>
### 豆瓣小组

View File

@ -15,10 +15,14 @@ module.exports = async (ctx) => {
const $ = cheerio.load(data); // 使用 cheerio 加载返回的 HTML
const list = $('div.grid_view > ul li'); // 使用 cheerio 选择器
const person = $('#content > h1')
.text()
.replace(/的全部作品(\d{1,}/, '');
let itemPicUrl;
ctx.state.data = {
title: '豆瓣电影-电影人作品',
title: `豆瓣电影人 - ${person}`,
link: `https://movie.douban.com/celebrity/${id}/movies?sortby=${sort}`,
item:
list &&