#' Read in your Alfred usage data
#'
#' @param file Location of SQLite file containing usage data
#' @export
load_usage <- function(file = "~/Library/Application\ Support/Alfred/knowledge.alfdb") {
if (!file.exists(file)) {
stop("Are you sure Alfred is installed?", call. = FALSE)
}
sql.con <- dbConnect("SQLite", file)
data <- dbReadTable(sql.con, name = "knowledge")
data$ts <- convert_timestamp(data$ts)
data <- categorize(data)
class(data) <- c("alfred", class(data))
return(data)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.