pastebin : Tools to work with the pastebin API

Pastebin is a website where you can store any text online for easy sharing. The website is mainly used by programmers to store pieces of sources code or configuration information, but anyone is more than welcome to paste any type of text. The idea behind the site is to make it more convenient for people to share large amounts of text online.

WIP!! The package API will very likely be in rapid change mode for a bit

The following functions are implemented:

If you want the impersonate parameter of new_paste() to work you must set PASTEBIN_USER and PASTEBIN_PASSWORD (preferably in ~/.Renviron).

TODO

Installation

devtools::install_github("hrbrmstr/pastebin")
options(width=120)

Usage

library(pastebin)
library(tidyverse)

# current verison
packageVersion("pastebin")

get_trending_pastes() %>% 
  arrange(desc(hits))

r_pastes <- get_recent_pastes(lang="rsplus")

glimpse(r_pastes)

Can't always trust the lang setting. Some non-R stuff in there:

walk(r_pastes$key[1:10], ~print(toString(get_paste(.))))

Since the user is obvious:

mebbe_r <- filter(r_pastes, user != "AllRls_net")
walk(mebbe_r$key, ~print(toString(get_paste(.))))

Test Results

library(pastebin)
library(testthat)

date()

test_dir("tests/")


hrbrmstr/pastebin documentation built on May 17, 2019, 5:12 p.m.