feat: douban people format
This commit is contained in:
parent
3049aca204
commit
cb95552de1
|
|
@ -6,13 +6,13 @@ function getContentByActivity(status) {
|
|||
switch (status.activity) {
|
||||
case '说':
|
||||
title = `${status.author.name} ${status.activity}:${status.text}`;
|
||||
description = `${status.author.name} ${status.activity}:${status.text}`;
|
||||
description = status.text;
|
||||
status.images.forEach((image) => {
|
||||
description += `<p><img src="${image.large.url}"/></p>`;
|
||||
});
|
||||
break;
|
||||
case '转发':
|
||||
description = `${status.text ? `${status.author.name} : ${status.text}<br><br>` : ''}`;
|
||||
description = `${status.text}<br>`;
|
||||
if (status.reshared_status.deleted) {
|
||||
title = `${status.author.name} ${status.activity} 广播:原动态已被发布者删除`;
|
||||
description += `原动态已被发布者删除`;
|
||||
|
|
@ -28,15 +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>'}`;
|
||||
description = `${status.text ? `${status.text}<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 += `<a href="${status.card.url}">《${status.card.title}》</a><br>豆瓣评分:${status.card.rating}<br>${status.card.subtitle}${image ? `<br><img src="${image}">` : ''}`;
|
||||
description += `豆瓣评分:${status.card.rating}<br>${status.card.subtitle}${image ? `<br><img src="${image}">` : ''}<br><a href="${status.card.url}">《${status.card.title}》</a>`;
|
||||
title = `${status.author.name}${status.activity}:《${status.card.title}》`;
|
||||
} else {
|
||||
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}">` : ''}`;
|
||||
description += `${status.card.subtitle}${image ? `<br><img src="${image}">` : ''}<br>${status.card.url ? `<a href="${status.card.url}">${status.card.title}</a>` : ''}`;
|
||||
title = `${status.author.name} ${status.activity}:「${status.card.title}」${status.text}`;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue