feat: quote repost and reply info for twitter and jike
This commit is contained in:
parent
aa163f433d
commit
cb03dd3059
|
|
@ -109,10 +109,13 @@ module.exports = async (ctx) => {
|
|||
pubDate: parseDate(item.createdAt),
|
||||
link: getLink(item.id, item.type),
|
||||
_extra: repostContent && {
|
||||
quote: {
|
||||
url: getLink(item.target.id, item.target.type),
|
||||
content_html: repostContent,
|
||||
},
|
||||
links: [
|
||||
{
|
||||
url: getLink(item.target.id, item.target.type),
|
||||
content_html: repostContent,
|
||||
type: 'quote',
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -385,12 +385,32 @@ const ProcessFeed = (ctx, { data = [] }, params = {}) => {
|
|||
pubDate: parseDate(item.created_at),
|
||||
link: `https://twitter.com/${item.user.screen_name}/status/${item.id_str}`,
|
||||
|
||||
_extra: item.is_quote_status && {
|
||||
quote: {
|
||||
url: `https://twitter.com/${item.quoted_status.user?.screen_name}/status/${item.quoted_status.id_str}`,
|
||||
content_html: quote,
|
||||
},
|
||||
},
|
||||
_extra:
|
||||
(isRetweet && {
|
||||
links: [
|
||||
{
|
||||
type: 'repost',
|
||||
},
|
||||
],
|
||||
}) ||
|
||||
(item.is_quote_status && {
|
||||
links: [
|
||||
{
|
||||
url: `https://twitter.com/${item.quoted_status.user?.screen_name}/status/${item.quoted_status.id_str}`,
|
||||
content_html: quote,
|
||||
type: 'quote',
|
||||
},
|
||||
],
|
||||
}) ||
|
||||
(item.in_reply_to_screen_name &&
|
||||
item.in_reply_to_status_id_str && {
|
||||
links: [
|
||||
{
|
||||
url: `https://twitter.com/${item.in_reply_to_screen_name}/status/${item.in_reply_to_status_id_str}`,
|
||||
type: 'reply',
|
||||
},
|
||||
],
|
||||
}),
|
||||
};
|
||||
});
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue