diff options
| author | Dhravya <[email protected]> | 2024-04-12 22:38:12 -0700 |
|---|---|---|
| committer | Dhravya <[email protected]> | 2024-04-12 22:38:12 -0700 |
| commit | 0d6cd7c447ccd4af05031d9897786abfee80b6b8 (patch) | |
| tree | abded39a0c9acc02399a69a1dd5c251d8e03ec83 /apps/web/src/server | |
| parent | Merge branch 'main' of https://github.com/Dhravya/supermemory (diff) | |
| download | supermemory-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.ts | 12 |
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; |