mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-02 01:58:11 +08:00
fix(route): crossbell replace punycode domain (#11872)
This commit is contained in:
@@ -6,17 +6,24 @@ module.exports = async (ctx) => {
|
|||||||
ctx.state.data = {
|
ctx.state.data = {
|
||||||
title: 'Crossbell Feeds of ' + characterId,
|
title: 'Crossbell Feeds of ' + characterId,
|
||||||
link: 'https://crossbell.io/',
|
link: 'https://crossbell.io/',
|
||||||
item: response.data?.list?.map((item) => ({
|
item: response.data?.list?.map((item) => {
|
||||||
title: `${item.type} ${item.character.metadata?.content?.name}@${item.character.handle}`,
|
let link = item.note ? item.note.metadata?.content?.external_urls?.[0] || `https://crossbell.io/notes/${item.note.characterId}-${item.note.noteId}` : 'https://xchar.app/' + item.character.handle;
|
||||||
description: `${item.type} ${item.note && `<br>Note: ${item.note.metadata?.content?.title || item.note.metadata?.content?.content}`}${
|
if (link.startsWith('https://xn--')) {
|
||||||
item.character && `<br>Character: ${item.character.metadata?.content?.name}@${item.character.handle}`
|
link = `https://crossbell.io/notes/${item.note?.characterId}-${item.note?.noteId}`;
|
||||||
}`,
|
}
|
||||||
link: item.note ? item.note?.metadata?.content?.external_urls || `https://crossbell.io/notes/${item.note?.characterId}-${item.note?.noteId}` : 'https://xchar.app/' + item.character?.handle,
|
|
||||||
pubDate: item.createdAt,
|
return {
|
||||||
updated: item.updatedAt,
|
title: `${item.type} ${item.character && item.character.metadata?.content?.name}@${item.character && item.character.handle}`,
|
||||||
author: item.note?.metadata?.content?.authors?.[0] || item.note?.character?.metadata?.content?.name || item.note?.character?.handle || item.owner,
|
description: `${item.type} ${item.note && `<br>Note: ${item.note.metadata?.content?.title || item.note.metadata?.content?.content}`}${
|
||||||
guid: item.transactionHash + item.logIndex + item.type,
|
item.character && `<br>Character: ${item.character.metadata?.content?.name}@${item.character.handle}`
|
||||||
category: [...(item.note?.metadata?.content?.sources || []), ...(item.note?.metadata?.content?.tags || [])],
|
}`,
|
||||||
})),
|
link,
|
||||||
|
pubDate: item.createdAt,
|
||||||
|
updated: item.updatedAt,
|
||||||
|
author: item.note?.metadata?.content?.authors?.[0] || item.note?.character?.metadata?.content?.name || item.note?.character?.handle || item.owner,
|
||||||
|
guid: item.transactionHash + item.logIndex + item.type,
|
||||||
|
category: [...(item.note?.metadata?.content?.sources || []), ...(item.note?.metadata?.content?.tags || [])],
|
||||||
|
};
|
||||||
|
}),
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,12 +1,18 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
getItem: (note) => ({
|
getItem: (note) => {
|
||||||
title: note.metadata?.content?.title || '',
|
let link = note.metadata?.content?.external_urls?.[0] ?? `https://crossbell.io/notes/${note.characterId}-${note.noteId}`;
|
||||||
description: note.metadata?.content?.content,
|
if (link.startsWith('https://xn--')) {
|
||||||
link: note.metadata?.content?.external_urls || `https://crossbell.io/notes/${note.characterId}-${note.noteId}`,
|
link = `https://crossbell.io/notes/${note.characterId}-${note.noteId}`;
|
||||||
pubDate: note.metadata?.content?.publishedAt,
|
}
|
||||||
updated: note.metadata?.content?.updatedAt,
|
return {
|
||||||
author: note.metadata?.content?.authors?.[0] || note.character?.metadata?.content?.name || note.character?.handle,
|
title: note.metadata?.content?.title || '',
|
||||||
guid: `${note.characterId}-${note.noteId}`,
|
description: note.metadata?.content?.content,
|
||||||
category: [...(note.metadata?.content?.sources || []), ...(note.metadata?.content?.tags || [])],
|
link,
|
||||||
}),
|
pubDate: note.metadata?.content?.publishedAt,
|
||||||
|
updated: note.metadata?.content?.updatedAt,
|
||||||
|
author: note.metadata?.content?.authors?.[0] || note.character?.metadata?.content?.name || note.character?.handle,
|
||||||
|
guid: `https://crossbell.io/notes/${note.characterId}-${note.noteId}`,
|
||||||
|
category: [...(note.metadata?.content?.sources || []), ...(note.metadata?.content?.tags || [])],
|
||||||
|
};
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user