feat: 豆瓣用户的广播雷达支持,微调内容输出 (#4764)
This commit is contained in:
parent
cf298a9f03
commit
7bc34d27de
|
|
@ -1998,4 +1998,18 @@
|
|||
},
|
||||
],
|
||||
},
|
||||
'douban.com': {
|
||||
_name: '豆瓣',
|
||||
www: [
|
||||
{
|
||||
title: '用户的广播',
|
||||
docs: 'https://docs.rsshub.app/social-media.html#dou-ban',
|
||||
source: '/people/:user/',
|
||||
target: (params, url, document) => {
|
||||
const uid = document && document.querySelector('html').innerHTML.match(/"id":"([0-9]+)"/)[1];
|
||||
return uid ? `/douban/people/${uid}/status` : '';
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -594,7 +594,7 @@ Tiny Tiny RSS 会给所有 iframe 元素添加 `sandbox="allow-scripts"` 属性
|
|||
|
||||
### 用户广播
|
||||
|
||||
<Route author="alfredcai" example="/douban/people/62759792/status" path="douban/people/:userid/status" :paramsDesc="['整数型用户 id']">
|
||||
<Route author="alfredcai" example="/douban/people/62759792/status" path="douban/people/:userid/status" :paramsDesc="['整数型用户 id']" radar="1">
|
||||
|
||||
::: tip 提示
|
||||
|
||||
|
|
|
|||
|
|
@ -6,13 +6,13 @@ function getContentByActivity(status) {
|
|||
switch (status.activity) {
|
||||
case '说':
|
||||
title = `${status.author.name} ${status.activity}:${status.text}`;
|
||||
description = status.text;
|
||||
description = `${status.author.name} ${status.activity}:${status.text}`;
|
||||
status.images.forEach((image) => {
|
||||
description += `<p><img src="${image.normal.url}"/></p>`;
|
||||
description += `<p><img src="${image.large.url}"/></p>`;
|
||||
});
|
||||
break;
|
||||
case '转发':
|
||||
description = `${status.text}<br>`;
|
||||
description = `${status.text ? `${status.author.name} : ${status.text}<br><br>` : ''}`;
|
||||
if (status.reshared_status.deleted) {
|
||||
title = `${status.author.name} ${status.activity} 广播:原动态已被发布者删除`;
|
||||
description += `原动态已被发布者删除`;
|
||||
|
|
@ -20,7 +20,7 @@ function getContentByActivity(status) {
|
|||
description += getContentByActivity(status.reshared_status).title;
|
||||
title = `${status.author.name} ${status.activity} ${status.reshared_status.author.name} 的广播:${status.reshared_status.text}`;
|
||||
status.reshared_status.images.forEach((image) => {
|
||||
description += `<p><img src="${image.normal.url}"/></p>`;
|
||||
description += `<p><img src="${image.large.url}"/></p>`;
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -28,14 +28,15 @@ function getContentByActivity(status) {
|
|||
default:
|
||||
if (status.card) {
|
||||
let image;
|
||||
description = `${status.author.name} ${status.activity} : ${status.text ? `${status.text}<br><br>` : '<br><br>'}`;
|
||||
if (status.card.image && (status.card.image.large || status.card.image.normal)) {
|
||||
image = (status.card.image.large || status.card.image.normal).url;
|
||||
}
|
||||
if (status.card.rating) {
|
||||
description = `${status.text ? `${status.author.name}的评分:${status.text}<br>` : ''}豆瓣评分:${status.card.rating}<br>${status.card.subtitle}${image ? `<br><img src="${image}">` : ''}`;
|
||||
description += `<a href="${status.card.url}">《${status.card.title}》</a><br>豆瓣评分:${status.card.rating}<br>${status.card.subtitle}${image ? `<br><img src="${image}">` : ''}`;
|
||||
title = `${status.author.name}${status.activity}:《${status.card.title}》`;
|
||||
} else {
|
||||
description = `${status.card.title}<br>${status.card.subtitle}${image ? `<br><img src="${image}">` : ''}`;
|
||||
description += `${status.card.url ? `<a href="${status.card.url}">${status.card.title}</a>` : status.card.title}<br>${status.card.subtitle}${image ? `<br><img src="${image}">` : ''}`;
|
||||
title = `${status.author.name} ${status.activity}:「${status.card.title}」${status.text}`;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue