RSS: print type in instagram user title
This commit is contained in:
parent
2374389be2
commit
1cc0a6f4ca
|
|
@ -27,9 +27,21 @@ module.exports = async (ctx) => {
|
|||
description: $('meta[name="description"]').attr('content'),
|
||||
item: list.map((item) => {
|
||||
item = item.node;
|
||||
let type = '';
|
||||
let tip = '';
|
||||
switch (item.__typename) {
|
||||
case 'GraphVideo':
|
||||
type = '[视频] ';
|
||||
tip = '打开原文播放视频: ';
|
||||
break;
|
||||
case 'GraphSidecar':
|
||||
type = '[组图] ';
|
||||
tip = '打开原文查看组图: ';
|
||||
break;
|
||||
}
|
||||
return {
|
||||
title: item.edge_media_to_caption.edges && item.edge_media_to_caption.edges[0] && item.edge_media_to_caption.edges[0].node.text || '无题',
|
||||
description: `${item.__typename === 'GraphVideo' ? '打开原文播放视频:' : ''}<img referrerpolicy="no-referrer" src="${item.thumbnail_src}">`,
|
||||
title: `${type}${item.edge_media_to_caption.edges && item.edge_media_to_caption.edges[0] && item.edge_media_to_caption.edges[0].node.text || '无题'}`,
|
||||
description: `${tip}<img referrerpolicy="no-referrer" src="${item.thumbnail_src}">`,
|
||||
pubDate: new Date(item.taken_at_timestamp * 1000).toUTCString(),
|
||||
link: `https://www.instagram.com/p/${item.shortcode}/`
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue