keybase : Tools to Work with the 'Keybase' 'API'
'Keybase' (https://keybase.io) is a directory of people and public keys and provides methods for obtaining public keys, validating users and exchanging files and/or messages in a secure fashion. Tools are provided to search for and retrieve information about 'Keybase' users, retrieve and import user public keys and list and/or download files.
There's also a thin but useful R wrapper around many of they keybase command-line utility functions.
The following functions are implemented:
General:
kb_discover: Check Keybase membership and retrieve basic user infokb_get_public_keys: Retrive the public key(s) for a given userkb_lookup: Retrieve info on Keybase user(s)kb_cmd: Execute a keybase command-line commandkb_followers: Get keybase followerskb_following: Get who you're following on keybasekb_whoami: Who does Keybase think you are?Crypto
kb_encrypt_file: Encrypt a filekb_decrypt_file: Decrypt a filekb_encrypt_msg: Encrypt a messagekb_decrypt_msg: Decrypt a messageFilesystem:
kb_list_files: List directory path contents in a Keybase user's public folderkb_file_exists: See if a file existskb_read_file: Read a resource (file) from a Keybase public folderkb_read_rds: Share RDS files with other Keybase userskb_write_rds: Share RDS files with other Keybase usersUtility:
kb_raw_url: Turn a user + path into a Keybase "raw" URLDiagnostics:
kb_ping: Test connectivity to the keybase serverkbfs_errors: Retrieve KBFS error logkbfs_metrics: Retrieve KBFS performance metricsdevtools::install_github("ropenscilabs/keybase")
options(width=120)
library(keybase) library(tidyverse) # current verison packageVersion("keybase") kb_ping() kb_discover(twitter=c("hrbrmstr", "_inundata", "briandconnelly"), github="bearloga") kb_discover(twitter=c("sckottie", "_inundata", "briandconnelly"), kb_usernames_only=TRUE) kb_lookup("karthik") kb_list_files("marcopolo") kb_list_files("marcopolo", pattern="\\.txt")
kb_list_files("hrbrmstr", "data") kb_file_exists("hrbrmstr", "index.md") kb_file_exists("https://hrbrmstr.keybase.pub/data/Rlogo.pngd") kb_raw_url("hrbrmstr", "data/Rlogo.png") kb_file_exists("hrbrmstr", "data/Rlogo.png") kb_file_exists(kb_raw_url("hrbrmstr", "data/Rlogo.png")) kb_read_file("hrbrmstr", "data/mtcars.csv") kb_read_file("hrbrmstr", "data/mtcars.json") # need (for now) to use the "raw" URL for things `rio::import()` can't natively read kb_list_files("hrbrmstr", "data", pattern = ".*.png") %>% select(raw_url) magick::image_read("https://hrbrmstr.keybase.pub/data/Rlogo.png")
library(keybase) library(testthat) date() test_dir("tests/")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.