All interactions with the 'pinboard.in' API (application programming interface) require authentication. This doc explains where to find your secrets and how to set up your computer so you can programmaticaly interact with pinboard.

Details

You do need to have a pinboard account.

Finding your secrets

Go to the pinboard password page and scroll down to API Token. It says something like: "this is your API token: username:NUMBERSANDLETTERS

.Renvironment file

I would recommend you add the token to your .renviron file, either locally or globally. A full introduction how these files work is beyond the scope of this doc but if you create a 'hidden' file named .Renviron in the project folder or in your home folder, R will read in the username and token and they will be available to pinboardr. Use usethis::edit_r_environ() or find the file manually.

Add to your .renviron file the following PB_USERNAME=username PB_TOKEN="NUMBERSANDLETTERS"

Restart the session to make the changes active.

Setting variables locally

This is not the recommended approach, but will work nevertheless. You can either:

Why is this not recommended?

This means your secrets, username and token are visible in your .rhistory, and if you save it in a script, it will be visible to anyone who opens your script. I think you don't want that, but my threatmodel is not your threatmodel.