New Pinboard import and update script

Hi all,

Based on Christians, Andreas’ and Rafaels earlier work, I worked on a Pinboard import script.

It had to be able to initially import my +5k bookmarks from Pinboard and keep them updated.

Features:

  • Uses Pinboard Auth Token instead of login credentials
  • Imports all your Pinboard bookmarks
  • Preserves timestamp of the most current post for update run
  • Supports “Decluttering” from the Web Clipper via heckyesmarkdown.com or instaper.com
  • … plus five more import strategies
  • Implements PDF fallback in case Decluttering seems to fail
  • Handles links to document files and binaries
  • Progress bar
  • macOS style group icon
  • Basic logging system

So far, it works for me.

If you use Pinboard, give it a go and tell me that you think.

@Christian, or everyone else at DT: If you want to use/publish it, feel free to do so.

gist.github.com/itst/780dee5c51 … c39166eb0f

5 Likes

Wow… quite a project. Thanks for sharing. I hope it can be of some use to Pinboard Users here.

Right after posting the message above and on my way to bed, I realized the import & update mechanism can easily be made more reliable.

Pinboard returns items in reverse chronological order, from current to oldest. Naivly I went ahead and did what you usually always do: process the data as it comes.

Instead, it would be beneficial to import the data backwards, starting with the last element and work your way up to the first.

I will start to implement this now.

gist.github.com/itst/780dee5c51 … c39166eb0f

This should be faster and more robost in case strange things happen.

Beware: heckyesmarkdown.com (as well as Brett’s other sites ) seems to be offline for now. Use Instapaper instead.

Thanks for the follow up.

Thanks for your work!

Just wanted to break my long streak of lurking on this forum in silence by thanking you for putting this together. I was recently playing with the default PinBoard script to no avail. This is really great and I appreciate you sharing it. Thanks.

You’re the first to let me know it actually works. Yay!
Glad it’s of use to anyone other than me :mrgreen:

I’m really excited for this but I can’t get it to work (note: probably user error). Do I just install it in the scripts directory, or is there something else I need to do? I tried inputting my token to the script but then it won’t save. :confused:

Do you generally know your way around with AppleScripts?

  1. Open Script Editor.
  2. Copy & paste the code from the gist (linked above) into Script Editor.
  3. Copy & paste your Pinboard API Token.
  4. Save. When asked for location, navigate to ~/Library/Application Support/DEVONthink Pro 2/Scripts
    (Or, in DevonThink, find the Script menu, click on Open Script Folder and the folder from there into Script Editor’s save dialog.
  5. Choose a subfolder and name the script. I placed my copy in the Import subfolder.
  6. Return the DevonThink, open the Script Folder, choose the subfolder from step 4 and click on the script name.
  7. Excitement!

Let me know if anything goes wrong.

I cannot figure it out, but I’m completely ignorant with scripting. This is the error:

tell application “DEVONthink Pro”
get record at “/Pinboard”
–> missing value
Result:
error “Can’t make «class DTco» of missing value into type text.” number -1700 from «class DTco» of missing value to text.

I put the API in, is there anything else I have to enter in the script?

Thanks!

Ben

No, the API key is all you need to enter.

Please, create a group named “Pinboard” in the database you want to use.
Then run the script again.

(Maybe I made an error when implementing the error checking …)

Sorry and thanks
Sascha

@itst, adding the Pinboard group worked! Thank you! :smiley:

So excited to use this.

Cool! I’m sorry it took you so long to get this running. I’ll look into that soon as possible.

Hopefully the script works well enough for you!

I updated the script, so that it can be run without the ‘Pinboard’ group present.

Thank you arielgreen for reporting this bug!

Ariel, did you change the URL in line 64?

See gist.github.com/itst/780dee5c51 … d-scpt-L64

This is important to actually import all you Pinboard bookmarks.

Thank you for this! I’m trying to get this to work. I’m getting errors in script editor when I try to edit the script and add my pinboard API. It says syntax error on the return the adjusted as string. Any ideas? :slight_smile:

Can you please post a screenshot of Script Editor showing the error message?

Screen Shot 2018-06-18 at 02.27.46.png

itst > I uploaded a screenshot. Thanks for your help

I’m having two issues with this script.

  1. When I have the Pinboard group in a database, it seems as though it never recognizes it and downloads all of the pinboard pages (web documents) to the root of the database (not in any folder). The log also states that it did not find the group. However, the spotlight comments in the group do update depending on what the most recent downloaded page was.
    Weird.

  2. At some point it freezes up for a large download. This may just be my machine however.

Thanks, not sure if you need more info or if this is happening to others???

Ben