fix: correct houxu/lives meta (#2837)

This commit is contained in:
刻诺
2019-08-12 22:14:34 +08:00
committed by DIYgod
parent 8bc499c461
commit 9ed3d37840
2 changed files with 12 additions and 13 deletions

View File

@@ -2,21 +2,20 @@ const got = require('@/utils/got');
const getLiveUrlById = (liveId) => `https://houxu.app/lives/${liveId}`;
const getLinkDesc = (link) => (link.media === null ? link.description : link.media.name + '<br />' + link.description);
const realtimeHandler = async () => {
const res = await got.get('https://houxu.app/api/1/lives/updated/');
const out = res.data.results.map((el) => ({
title: el.last.link.title,
description: getLinkDesc(el.last.link),
description: el.last.link.description,
author: el.last.link.media ? el.last.link.media.name : null,
link: getLiveUrlById(el.id),
guid: 'realtime-' + el.id + '-' + el.last.id,
pubDate: new Date(el.last.create_at).toUTCString(),
pubDate: new Date(el.news_update_at).toUTCString(),
}));
return {
title: 'Live 实时 - 后续',
title: '往事进展 - 后续',
description: 'Live 往事进展',
link: 'https://houxu.app/lives/realtime',
item: out,
@@ -30,13 +29,13 @@ const newHandler = async () => {
.map((el) => ({
title: el.object.title,
description: el.object.summary,
link: getLiveUrlById(el.id),
guid: 'new-' + el.id + '-' + el.object.id,
pubDate: new Date(el.object.create_at).toUTCString(),
link: getLiveUrlById(el.object.id),
guid: 'new-' + el.object.id,
pubDate: new Date(el.publish_at).toUTCString(),
}));
return {
title: '最近 Live - 后续',
description: 'Live 最新关注',
title: '最新添加 - 后续',
description: 'Live 最新添加',
link: 'https://houxu.app/lives/new',
item: out,
};