knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

pinboardr

CRAN status license lifecycle Project Status: Active – The project has reached a stable, usable state and is being actively developed. Travis build status

The goal of pinboardr is to interact with the pinboard.in website. You can use this package to

Basically everything you can do through the website, but from an R session. This is a full implementation of all the endpoints in https://pinboard.in/api.

All user facing functions start with pb_* , making it easy to use autocompletion in your IDE. Just type pb_ and the suggestions come up.

What is pinboard

Pinboard is a personal archive for things you find online and don't want to forget. The site has been around since July 2009 and has about 25,000 active users.

If you don't know what pinboard is, this is not a package for you. If you would like to know more about pinboard, take the tour.

This is NOT a package for 'pinterest': An image sharing service. There is a rpinterest package for that.

Installation

You can install the released version of pinboardr from CRAN with:

install.packages("pinboardr")

And the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("RMHogervorst/pinboardr")

Credentials

This is a package to interact with 'https://pinboard.in, a payed (not free) bookmarking website. To use this package you need to use your username and token from pinboard. See also ?authentication for more details.

Go to the pinboard password page and scroll down to API Token. It says something like: "this is your API token: username:NUMBERSANDLETTERS My recommendation would be to add this token and username to your local or global .Renvironment file (use for example usethis::edit_r_environ() to find that file on your computer).

PB_USERNAME=username 
PB_TOKEN="NUMBERSANDLETTERS"

Restart your session to make the changes active.

Examples

This part shows you some of the functions implemented in this package.

library(pinboardr)

When was my last update on pinboard?

pb_last_update()

Get your most recent bookmarks (of a certain tag, or globally)

recent <- pb_posts_recent(tags = "inspiration",count = 3)
recent[,c("title", "toread","tags")]

When did I bookmark all my bookmarks?

library(ggplot2) 
library(dplyr)
per_date <- pb_posts_dates()

per_date %>% 
  mutate(date = as.POSIXct(date)) %>% 
  ggplot(aes(date, count)) + 
  geom_col()+
  labs(title="When did I bookmark?")

Did I read all my bookmarks with the tag inspiration?

all <- pb_posts_all(tags = "inspiration", todt="2020-01-01")
table(all$toread)

Most common tags with inspiration

huge_vec <- unlist(strsplit(all$tags, split=" "))
# note that this is way more intuitive with dplyr
# data.frame(vec=huge_vec) %>% group_by(vec) %>% count() %>% arrange(desc(n))
counted <- as.data.frame(table(huge_vec))
top <- counted[counted$Freq >1,]
top[order(top$Freq,decreasing = TRUE),]

Can we extract all of the bookmarks with the blogidea tag?

all_blogidea <- pb_add_tag_column(all, "blogidea")
all_blogidea[all_blogidea$blogidea,c("href","title")]

Get all tags used

all_tags <- pb_tags_get() # will show all 583 tags I have used
head(all_tags, 4)

Please note that the "pinboardr" project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.



RMHogervorst/pinboardr documentation built on Aug. 9, 2020, 8:55 p.m.