fedimbed: guh

This commit is contained in:
Cynthia Foxwell 2025-06-23 17:53:53 -06:00
parent f24e645c62
commit c75a0b938f
Signed by: Cynosphere
SSH key fingerprint: SHA256:H3SM8ufP/uxqLwKSH7xY89TDnbR9uOHzjLoBr0tlajk

View file

@ -21,6 +21,7 @@ const BSKY_POST_REGEX =
/^\/profile\/(did:plc:[a-z0-9]+|(did:web:)?[a-z0-9][a-z0-9.-]+[a-z0-9]*)\/post\/([a-z0-9]+)\/?$/i; /^\/profile\/(did:plc:[a-z0-9]+|(did:web:)?[a-z0-9][a-z0-9.-]+[a-z0-9]*)\/post\/([a-z0-9]+)\/?$/i;
const PATH_REGEX = { const PATH_REGEX = {
truthsocial: /^\/@(.+?)\/posts\/\d+\/?/i,
mastodon: /^\/@(.+?)\/([a-z0-9]+?)\/?/i, mastodon: /^\/@(.+?)\/([a-z0-9]+?)\/?/i,
mastodon2: /^\/(.+?)\/statuses\/([a-z0-9]+?)\/?/i, mastodon2: /^\/(.+?)\/statuses\/([a-z0-9]+?)\/?/i,
pleroma: /^\/objects\/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\/?/, pleroma: /^\/objects\/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\/?/,
@ -33,7 +34,6 @@ const PATH_REGEX = {
//cohost: /^\/[A-Za-z0-9]+\/post\/\d+-[A-Za-z0-9-]+\/?/, //cohost: /^\/[A-Za-z0-9]+\/post\/\d+-[A-Za-z0-9-]+\/?/,
bluesky: BSKY_POST_REGEX, bluesky: BSKY_POST_REGEX,
twitter: /^\/([a-z0-9_]+)\/status\/(\d+)\/?/i, twitter: /^\/([a-z0-9_]+)\/status\/(\d+)\/?/i,
truthsocial: /^\/@(.+?)\/posts\/\d+\/?/i,
}; };
const PLATFORM_COLORS = { const PLATFORM_COLORS = {
@ -118,7 +118,7 @@ function firefoxUseragent() {
const now = Math.floor(Date.now() / 1000); const now = Math.floor(Date.now() / 1000);
const version = Math.floor(124 + (now - 1710892800) / 2419200); const version = Math.floor(124 + (now - 1710892800) / 2419200);
return `\`Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:${version}.0) Gecko/20100101 Firefox/${version}.0\``; return `Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:${version}.0) Gecko/20100101 Firefox/${version}.0`;
} }
async function resolvePlatform(url) { async function resolvePlatform(url) {