New Pinboard import and update script

I have no idea why the script would be slow – I’m really, really not comfortable with AppleScript (that’s me trying to use a diplomatic wording). You could try to contact the original author here, through github, twitter or their personal website (see GitHub)

I had this Pinboard import working well on DEVONthink 3 with my old iMac (Catalina). I copied the same script to my new MacBook Pro M1 with Big Sur. It prints only one log message and then seems to do nothing. These last comments seem to be related to the same issue. I tried to do some modifications for logs, but still it only prints the log message. I’m also not at all comfortable with AppleScript, I don’t undestand why there’s somethings my before a log message, sometimes not, etc. I’ll spend some time if I can get it working.

Edit: Thank you Thank you @chrillek! I got it working after doing that log change. I currently have “only” around 500 bookmarks since I cleaned them up some time ago, and it was quite fast. I also commented the parts out that was downloading pdf, etc instead of just saving bookmarks.

1 Like

Thanks @chrillek - that’s helpful.

@itst - thank you for writing the script. As an applescript / devonthink newbie, I wonder if you can advise a/ why it might be slow, and b/ whether its possible to set the script to download text-only versions of the bookmarks, at present it downloads full web-pages, which can be multiple MBs in size.

Thanks again

Many thanks to both @itst and @chrillek - I’ve now used this script to import my Pinboard bookmarks. Much appreciated! :slight_smile:

1 Like

Wow, there‘s some things to unpack here! First, @chrillek, thank you so much for helping @semrys out. I will look into this, to make sure it does not happen again.

@semrys, as to your question why the script is slow. This is not about the script itself, but what it does: It opens your bookmarks in a headless browser and converts them to a meaningful format, one bookmark at a time.

I understand that doing that for 20k bookmarks might take a while. It took about four hours to initially download my collection of about 5k bookmarks.

The script can employ a couple of different strategies. It defaults to »decluttered«, which should give you the fastest results. This is highly depending on the exact websites you have bookmarked, though. If theee sites are big/slow, the script will take its time, I am afraid.

Thank you for responding to this, @itst - really appreciated, and of course grateful for the script!

Absolutely understood re pace of downloads. It’s done, but it did take about 2 days!

On the ‘decluttered’ - and this may be off topic - is there a way for a/ display to default to text only (like a browser ‘reader mode’ and b/ for Devonthink to maintain login status for websites (eg I have many twitter bookmarks in pinboard, but though the links have been downloaded I ahve to log-in for each downloaded page, if that makes sense?).

Thanks again

@BLUEFROG should be better positioned to answer this. I remember that there was a thread before (or some posts in a thread) concerning this issue. It was revolving around cookies, iirc. Right: Cookies (ostensibly) being lost/flushed in DT3 despite setting to keep, but kind of fizzled out.
Maybe DT does not preserve the login cookies since it is not a complete browser?

If I understand the script correctly, “decluttered” produces a markdown document. That is already pretty much “text only”. Do you get something else or is that not text only enough?

Thanks for this—I’ve been looking for a way to finally get all my bookmarks into one place (DT3). The script works great after making the change mentioned above (it’s near the very end). Even my tags were imported, leaving me with very little cleanup to do aside from deleting junk/dead bookmarks.

1 Like

I am still curious why you have issues with the logging as mentioned in New Pinboard import and update script - #59 by chrillek

I cannot replicate this on my machine …

Maybe you’re using an older or newer version of AppleScript/DT?

I’m on Big Sur with DT 3.7.1. Regardless of that, as I said before: There’s a simple workaround, namely casting loginfo to a String. The (apparent) conversion of info false to without info might be one of the idiosyncracies of AppleScript or DT. In any case, the documentation of log message in the DT AppleScript dictionary clearly states that info expects a Textparameter. So casting (“coercing” in Apple parlance) it to that type should be a safe option.

Sorry. It took me a long while to come back to this. I fixed this just in the way @chrillek suggested. Thank you!

The gist is up-to-date: Import and regularly replicate your Pinboard bookmarks in DEVONthink. · GitHub

It‘s been five years! Wow!

The script still works and does its job without me even thinking about it - thanks to the scheduling documented here.

I hope it‘s still helpful for you guys, too!

1 Like