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