aboutsummaryrefslogtreecommitdiff
path: root/apps/web/src/server
diff options
context:
space:
mode:
authorDhravya <[email protected]>2024-04-12 22:38:12 -0700
committerDhravya <[email protected]>2024-04-12 22:38:12 -0700
commit0d6cd7c447ccd4af05031d9897786abfee80b6b8 (patch)
treeabded39a0c9acc02399a69a1dd5c251d8e03ec83 /apps/web/src/server
parentMerge branch 'main' of https://github.com/Dhravya/supermemory (diff)
downloadsupermemory-0d6cd7c447ccd4af05031d9897786abfee80b6b8.tar.xz
supermemory-0d6cd7c447ccd4af05031d9897786abfee80b6b8.zip
added logic for importing all tweets
Diffstat (limited to 'apps/web/src/server')
-rw-r--r--apps/web/src/server/helpers.ts12
1 files changed, 7 insertions, 5 deletions
diff --git a/apps/web/src/server/helpers.ts b/apps/web/src/server/helpers.ts
index 519e4b17..109fa0c3 100644
--- a/apps/web/src/server/helpers.ts
+++ b/apps/web/src/server/helpers.ts
@@ -17,17 +17,19 @@ export async function getMetaData(url: string) {
? descriptionMatch[1]
: "Description not found";
- // Extract Open Graph image
- const imageMatch = html.match(
- /<meta property="og:image" content="(.*?)"\s*\/?>/,
+ // Extract favicon
+ const faviconMatch = html.match(
+ /<link rel="(?:icon|shortcut icon)" href="(.*?)"\s*\/?>/,
);
- const image = imageMatch ? imageMatch[1] : "Image not found";
+ const favicon = faviconMatch
+ ? faviconMatch[1]
+ : "https://supermemory.dhr.wtf/web.svg";
// Prepare the metadata object
const metadata = {
title,
description,
- image,
+ image: favicon,
baseUrl,
};
return metadata;