feat: 添加豆瓣广播标题 (#3912)
This commit is contained in:
parent
4671720f4c
commit
5ddf4c7698
|
|
@ -569,7 +569,7 @@ Tiny Tiny RSS 会给所有 iframe 元素添加 `sandbox="allow-scripts"` 属性
|
|||
::: tip 提示
|
||||
|
||||
- **目前只支持整数型 id**
|
||||
- 字母型的 id,可以通过头像图片链接来找到其整数型 id,图片命名规则`ul[userid]-*.jpg`
|
||||
- 字母型的 id,可以通过头像图片链接来找到其整数型 id,图片命名规则`ul[userid]-*.jpg`或`u[userid]-*.jpg`,即取文件名中间的数字
|
||||
- 例如:用户 id: `MovieL`他的头像图片链接:`https://img1.doubanio.com/icon/ul1128221-98.jpg`他的整数型 id: `1128221`
|
||||
|
||||
:::
|
||||
|
|
|
|||
|
|
@ -54,19 +54,23 @@ module.exports = async (ctx) => {
|
|||
|
||||
const items = response.data.items;
|
||||
|
||||
const username = items ? items[0].status.author.name : '';
|
||||
|
||||
ctx.state.data = {
|
||||
title: `豆瓣广播-${userid}`,
|
||||
title: `豆瓣广播 - ${username ? username : userid}`,
|
||||
link: `https://m.douban.com/people/${userid}/statuses`,
|
||||
item: items
|
||||
.filter((item) => !item.deleted)
|
||||
.map((item) => {
|
||||
const r = getContentByActivity(item.status);
|
||||
return {
|
||||
title: r.title,
|
||||
link: item.status.sharing_url,
|
||||
pubDate: new Date(Date.parse(item.status.create_time + ' GMT+0800')).toUTCString(),
|
||||
description: r.description,
|
||||
};
|
||||
}),
|
||||
item:
|
||||
items &&
|
||||
items
|
||||
.filter((item) => !item.deleted)
|
||||
.map((item) => {
|
||||
const r = getContentByActivity(item.status);
|
||||
return {
|
||||
title: r.title,
|
||||
link: item.status.sharing_url,
|
||||
pubDate: new Date(Date.parse(item.status.create_time + ' GMT+0800')).toUTCString(),
|
||||
description: r.description,
|
||||
};
|
||||
}),
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue