mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-24 23:12:34 +08:00
rss: twitter user: add images
This commit is contained in:
+13
-6
@@ -16,11 +16,18 @@ module.exports = async (ctx) => {
|
||||
title: `${data[0].user.name} 的 Twitter`,
|
||||
link: `https://twitter.com/${id}/`,
|
||||
description: data[0].user.description,
|
||||
item: data.map((item) => ({
|
||||
title: `${item.in_reply_to_screen_name ? 'Re ' : ''}${item.text.length > 30 ? item.text.slice(0, 30) + '...' : item.text}`,
|
||||
description: `${item.in_reply_to_screen_name ? 'Re ' : ''}${item.text}`,
|
||||
pubDate: new Date(item.created_at).toUTCString(),
|
||||
link: `https://twitter.com/${id}/status/${item.id_str}`,
|
||||
})),
|
||||
item: data.map((item) => {
|
||||
let img = '';
|
||||
item.extended_entities &&
|
||||
item.extended_entities.media.forEach((item) => {
|
||||
img += `<br>${item.type === 'video' ? 'Video: ' : ''}<img referrerpolicy="no-referrer" src="${item.media_url_https}">`;
|
||||
});
|
||||
return {
|
||||
title: `${item.in_reply_to_screen_name ? 'Re ' : ''}${item.text.length > 30 ? item.text.slice(0, 30) + '...' : item.text}`,
|
||||
description: `${item.in_reply_to_screen_name ? 'Re ' : ''}${item.text}${img}`,
|
||||
pubDate: new Date(item.created_at).toUTCString(),
|
||||
link: `https://twitter.com/${id}/status/${item.id_str}`,
|
||||
};
|
||||
}),
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user