fedimbed: dont include original platform name if its in the crawled platform name
This commit is contained in:
parent
ea63a96ec1
commit
27f8563c4f
1 changed files with 9 additions and 2 deletions
|
@ -50,6 +50,7 @@ const PLATFORM_COLORS = {
|
||||||
pixelfed: 0x10c5f8,
|
pixelfed: 0x10c5f8,
|
||||||
//cohost: 0x83254f,
|
//cohost: 0x83254f,
|
||||||
bluesky: 0x0085ff,
|
bluesky: 0x0085ff,
|
||||||
|
nitter: 0xff6c60,
|
||||||
twitter: 0xff6c60, // Nitter accent color
|
twitter: 0xff6c60, // Nitter accent color
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -200,10 +201,10 @@ async function getCrawledData(url, color, platformName) {
|
||||||
if (platformName == "<no nodeinfo>") {
|
if (platformName == "<no nodeinfo>") {
|
||||||
platformName = tag.$content;
|
platformName = tag.$content;
|
||||||
} else {
|
} else {
|
||||||
platformName = `${tag.$content} (${platformName})`;
|
platformName = tag.$content.includes(platformName) ? tag.$content : `${tag.$content} (${platformName})`;
|
||||||
}
|
}
|
||||||
} else if (!color && tag.$name == "theme-color") {
|
} else if (!color && tag.$name == "theme-color") {
|
||||||
color = parseInt(tag.$content.replace("^#", "0x"));
|
color = parseInt(tag.$content.replace(/^#/, "0x"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1453,6 +1454,12 @@ async function processUrl(msg, url, spoiler = false, command = false) {
|
||||||
platformName = crawled.platformName;
|
platformName = crawled.platformName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (platformName.includes("Nitter") && platformName.includes(" \u2022 ")) {
|
||||||
|
const [ns, nn] = platformName.split(" \u2022 ");
|
||||||
|
stats = ns;
|
||||||
|
platformName = nn;
|
||||||
|
}
|
||||||
|
|
||||||
const baseEmbed = {
|
const baseEmbed = {
|
||||||
color,
|
color,
|
||||||
url,
|
url,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue