mirror of
https://github.com/CompeyDev/fxtwitter-docker.git
synced 2025-04-04 10:00:55 +01:00
improved card embedding
This commit is contained in:
parent
29f718f599
commit
cd9086f63a
2 changed files with 12 additions and 5 deletions
|
@ -95,7 +95,6 @@ export const renderCard = async (
|
|||
`<meta property="og:type" content="video.other">`,
|
||||
`<meta property="og:video:url" content="${values.player_url.string_value}">`,
|
||||
`<meta property="og:video:secure_url" content="${values.player_url.string_value}">`,
|
||||
`<meta property="og:video:type" content="text/html">`,
|
||||
`<meta property="og:video:width" content="${
|
||||
values.player_width?.string_value || '1280'
|
||||
}">`,
|
||||
|
@ -103,6 +102,8 @@ export const renderCard = async (
|
|||
values.player_height?.string_value || '720'
|
||||
}">`
|
||||
);
|
||||
|
||||
str = 'EMBED_CARD';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -59,12 +59,18 @@ export const handleStatus = async (
|
|||
|
||||
let authorText = 'Twitter';
|
||||
|
||||
if (tweet.card) {
|
||||
text += await renderCard(tweet.card, headers, userAgent);
|
||||
}
|
||||
|
||||
text = linkFixer(tweet, text);
|
||||
|
||||
if (tweet.card) {
|
||||
let cardRender = await renderCard(tweet.card, headers, userAgent);
|
||||
|
||||
if (cardRender === 'EMBED_CARD') {
|
||||
authorText = encodeURIComponent(text);
|
||||
} else {
|
||||
text += cardRender;
|
||||
}
|
||||
}
|
||||
|
||||
let quoteTweetMaybe =
|
||||
conversation.globalObjects?.tweets?.[tweet.quoted_status_id_str || '0'] || null;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue