ckolderup / postmarks

a single-user bookmarking website designed to live on the Fediverse
https://postmarks.glitch.me
MIT License
465 stars 38 forks source link

CSV import #23

Open ckolderup opened 1 year ago

ckolderup commented 1 year ago

~We have the rudimentary import feature in the admin page but we should support an import that maintains custom metadata (title, description, tags) and possibly even datetime?~

UPDATE: To be specific and make this ticket cleanly scoped, we should support the CSV export format from #118. Additional import formats from other tools should be filed as separate tickets so they can be prioritized based on demand.

jasonkgreen commented 12 months ago

When I try to import I get the following error:

failed to start application on pinakes.glitch.me

This is most likely because your project has a code error. Check your project logs, fix the error and try again.

andypiper commented 12 months ago

Confirmed here. Log shows:

[2023-9-11 20:28:59] POST:/bookmark/multiadd 200 0.002ms
unable to parse url 
couldn't fetch opengraph data for https://www.printables.com/@AndyPiper
couldn't fetch opengraph data for https://cults3d.com/en/users/andypiper
couldn't fetch opengraph data for https://www.thingiverse.com/andypiperuk/
couldn't fetch opengraph data for https://www.tinkercad.com/users/0z2EwxKwnmp-andy-piper
couldn't fetch opengraph data for https://thangs.com/designer/Andy%20Piper
couldn't fetch opengraph data for https://pinshape.com/users/2556538-andy-piper
couldn't fetch opengraph data for https://www.youmagine.com/andypiper/designs
couldn't fetch opengraph data for https://www.myminifactory.com/users/andypiper
file:///app/src/routes/bookmark.js:182
      title: meta.result.ogTitle,
                         ^
TypeError: Cannot read properties of undefined (reading 'ogTitle')
at file:///app/src/routes/bookmark.js:182:26
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

So it looks like the multiadd operation is failing to fetch opengraph tags to populate the entries. I'll see what I can figure out here.

andypiper commented 12 months ago

(however, this is a bug, and not directly connected to @ckolderup original issue / enhancement idea, which we should retain)

ckolderup commented 12 months ago

if it helps with the bug, I swapped opengraph libraries very hastily just before launch to clear up some security warnings that were being introduced and probably missed some refactoring in the process! (yet another reason I really need to get tests/checks in place)

the opengraph resolution stuff should probably be extracted / reused for both single- and multi-add processes. (and if you don't get to it, I can probably fix this this week, things have just been a little hectic all of a sudden)

andypiper commented 12 months ago

just submitted #91 which I would describe as a monkeypatch 🙂 and yeah, a better solution would be to run the OG resolution in one place rather than split between two locations.