mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-02 01:58:11 +08:00
feat: generate quote content_html, telegram channel repost extra data
This commit is contained in:
@@ -139,6 +139,11 @@ module.exports = async (ctx, next) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
item.description = $('body').html() + '' + (config.suffix || '');
|
item.description = $('body').html() + '' + (config.suffix || '');
|
||||||
|
|
||||||
|
const quote = item._extra?.links?.find((e) => e.type === 'quote');
|
||||||
|
if (quote && $('.rsshub-quote').length) {
|
||||||
|
quote.content_html = $.html($('.rsshub-quote'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return item;
|
return item;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -112,7 +112,6 @@ module.exports = async (ctx) => {
|
|||||||
links: [
|
links: [
|
||||||
{
|
{
|
||||||
url: getLink(item.target.id, item.target.type),
|
url: getLink(item.target.id, item.target.type),
|
||||||
content_html: repostContent,
|
|
||||||
type: 'quote',
|
type: 'quote',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -120,6 +120,7 @@ module.exports = async (ctx) => {
|
|||||||
list
|
list
|
||||||
.map((index, item) => {
|
.map((index, item) => {
|
||||||
item = $(item);
|
item = $(item);
|
||||||
|
let extra = null;
|
||||||
|
|
||||||
/* message types */
|
/* message types */
|
||||||
let msgTypes = [];
|
let msgTypes = [];
|
||||||
@@ -208,6 +209,15 @@ module.exports = async (ctx) => {
|
|||||||
fwdFrom += ` (${fwdFromAuthorObj.text()})`;
|
fwdFrom += ` (${fwdFromAuthorObj.text()})`;
|
||||||
}
|
}
|
||||||
fwdFrom += '</p>';
|
fwdFrom += '</p>';
|
||||||
|
|
||||||
|
extra = {
|
||||||
|
links: [
|
||||||
|
{
|
||||||
|
type: 'repost',
|
||||||
|
url: userLink,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
}
|
}
|
||||||
return fwdFrom;
|
return fwdFrom;
|
||||||
};
|
};
|
||||||
@@ -576,6 +586,8 @@ module.exports = async (ctx) => {
|
|||||||
enclosure_url: voiceUrl,
|
enclosure_url: voiceUrl,
|
||||||
itunes_duration: voiceDuration(),
|
itunes_duration: voiceDuration(),
|
||||||
enclosure_type: 'audio/ogg',
|
enclosure_type: 'audio/ogg',
|
||||||
|
|
||||||
|
_extra: extra,
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
.get()
|
.get()
|
||||||
|
|||||||
@@ -397,7 +397,6 @@ const ProcessFeed = (ctx, { data = [] }, params = {}) => {
|
|||||||
links: [
|
links: [
|
||||||
{
|
{
|
||||||
url: `https://twitter.com/${item.quoted_status?.user?.screen_name}/status/${item.quoted_status?.id_str}`,
|
url: `https://twitter.com/${item.quoted_status?.user?.screen_name}/status/${item.quoted_status?.id_str}`,
|
||||||
content_html: quote,
|
|
||||||
type: 'quote',
|
type: 'quote',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user