From fbe7e3a901862e5766662735a623a5a935c87c0b Mon Sep 17 00:00:00 2001 From: Daniel Wieser Date: Mon, 9 Feb 2026 01:06:54 +0100 Subject: feat: Added Import for Instapaper (#2434) * Added Instapaper import * Fixes #1444 Added Instapaper import support --- apps/web/components/settings/ImportExport.tsx | 19 ++++++++ apps/web/lib/i18n/locales/en/translation.json | 1 + packages/shared/import-export/parsers.ts | 64 ++++++++++++++++++++++++++- 3 files changed, 83 insertions(+), 1 deletion(-) diff --git a/apps/web/components/settings/ImportExport.tsx b/apps/web/components/settings/ImportExport.tsx index 4aa84e44..e02297c9 100644 --- a/apps/web/components/settings/ImportExport.tsx +++ b/apps/web/components/settings/ImportExport.tsx @@ -270,6 +270,25 @@ export function ImportExportRow() {

Import

+ + + runUploadBookmarkFile({ file, source: "instapaper" }) + } + > +

Import

+
+
{ + let content: ParsedBookmark["content"]; + if (record.URL && record.URL.trim().length > 0) { + content = { type: BookmarkTypes.LINK as const, url: record.URL.trim() }; + } else if (record.Selection && record.Selection.trim().length > 0) { + content = { + type: BookmarkTypes.TEXT as const, + text: record.Selection.trim(), + }; + } + + const addDate = parseInt(record.Timestamp); + + let tags: string[] = []; + try { + const parsedTags = JSON.parse(record.Tags); + if (Array.isArray(parsedTags)) { + tags = parsedTags.map((tag) => tag.toString().trim()); + } + } catch { + tags = []; + } + + return { + title: record.Title || "", + content, + addDate, + tags, + paths: [], // TODO + }; + }); +} + function deduplicateBookmarks(bookmarks: ParsedBookmark[]): ParsedBookmark[] { const deduplicatedBookmarksMap = new Map(); const textBookmarks: ParsedBookmark[] = []; @@ -428,6 +487,9 @@ export function parseImportFile( case "mymind": result = parseMymindBookmarkFile(textContent); break; + case "instapaper": + result = parseInstapaperBookmarkFile(textContent); + break; } return deduplicateBookmarks(result); } -- cgit v1.2.3-70-g09d2