From f1cf49012a439ec47859a693e0575df31c3db22e Mon Sep 17 00:00:00 2001
From: bigint <69431456+bigint@users.noreply.github.com>
Date: Tue, 30 Jan 2024 17:13:56 +0530
Subject: [PATCH 1/2] fic: console
---
apps/api/src/lib/oembed/meta/generateIframe.ts | 2 --
1 file changed, 2 deletions(-)
diff --git a/apps/api/src/lib/oembed/meta/generateIframe.ts b/apps/api/src/lib/oembed/meta/generateIframe.ts
index 940a80bae1fd..14e1ca0e9a11 100644
--- a/apps/api/src/lib/oembed/meta/generateIframe.ts
+++ b/apps/api/src/lib/oembed/meta/generateIframe.ts
@@ -57,8 +57,6 @@ const generateIframe = (
return null;
}
- console.log('figmaRegex', figmaRegex.test(cleanedUrl));
-
switch (hostname) {
case 'youtube.com':
case 'youtu.be': {
From 19d2eb8d82aa80977b9562077889e16d67fb0483 Mon Sep 17 00:00:00 2001
From: bigint <69431456+bigint@users.noreply.github.com>
Date: Tue, 30 Jan 2024 17:14:56 +0530
Subject: [PATCH 2/2] chore: kill figma and spline usage
---
.../api/src/lib/oembed/meta/generateIframe.ts | 32 ++-----------------
1 file changed, 2 insertions(+), 30 deletions(-)
diff --git a/apps/api/src/lib/oembed/meta/generateIframe.ts b/apps/api/src/lib/oembed/meta/generateIframe.ts
index 14e1ca0e9a11..288a7f7e21da 100644
--- a/apps/api/src/lib/oembed/meta/generateIframe.ts
+++ b/apps/api/src/lib/oembed/meta/generateIframe.ts
@@ -6,20 +6,11 @@ const knownSites = [
'kick.com',
'open.spotify.com',
'soundcloud.com',
- 'oohlala.xyz',
- 'my.spline.design',
- 'www.figma.com',
- 'figma.com'
+ 'oohlala.xyz'
];
// URLs that are manually picked to be embedded that dont have embed metatags
-const pickUrlSites = [
- 'open.spotify.com',
- 'kick.com',
- 'my.spline.design',
- 'www.figma.com',
- 'figma.com'
-];
+const pickUrlSites = ['open.spotify.com', 'kick.com'];
// URLs that should not have query params removed
const skipClean = ['youtube.com', 'youtu.be'];
@@ -38,9 +29,6 @@ const tapeRegex =
/^https?:\/\/tape\.xyz\/watch\/[\dA-Za-z-]+(\?si=[\dA-Za-z]+)?$/;
const twitchRegex = /^https?:\/\/www\.twitch\.tv\/videos\/[\dA-Za-z-]+$/;
const kickRegex = /^https?:\/\/kick\.com\/[\dA-Za-z-]+$/;
-const splineRegex = /^https?:\/\/my\.spline\.design\/[\dA-Za-z-]+\/?$/;
-const figmaRegex =
- /^https:\/\/(www\.)?figma\.com\/(file|proto)\/[^/]+\/[^/?]+\/?$/;
const generateIframe = (
embedUrl: null | string,
@@ -120,22 +108,6 @@ const generateIframe = (
return null;
}
- case 'my.spline.design': {
- if (splineRegex.test(cleanedUrl)) {
- return ``;
- }
-
- return null;
- }
- case 'figma.com':
- case 'www.figma.com': {
- if (figmaRegex.test(cleanedUrl)) {
- const figmaUrl = `https://www.figma.com/embed?embed_host=share&url=${cleanedUrl}`;
- return ``;
- }
-
- return null;
- }
default:
return ``;
}