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.
You do need to have a pinboard account.
Go to the pinboard password page
and scroll down to API Token.
It says something like: "this is your API token:
username:NUMBERSANDLETTERS
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.
This is not the recommended approach, but will work nevertheless. You can either:
set the variables at the start of your session using Sys.setenv(PB_USERNAME = "username", PB_TOKEN="NUMBERSANDLETTERS")
pass the username and token to every command: pb_last_update(username=username, token=NUMBERSANDLETTERS)
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.