mirror of https://git.sr.ht/~hrbrmstr/hgr
boB Rudis
7 years ago
7 changed files with 52 additions and 3 deletions
@ -0,0 +1,19 @@ |
|||||
|
#' Take URL from clipboard and get the facts! |
||||
|
#' |
||||
|
#' @export |
||||
|
jtf_addin <- function() { |
||||
|
|
||||
|
clip_txt <- trimws(clipr::read_clip())[1] |
||||
|
|
||||
|
if (grepl("^http[s]://", clip_txt)) { |
||||
|
|
||||
|
var_name <- temp_name() |
||||
|
|
||||
|
code_to_exec <- sprintf("print(%s <- hgr::just_the_facts('%s'))", |
||||
|
var_name, clip_txt) |
||||
|
|
||||
|
rstudioapi::sendToConsole(code_to_exec, execute = TRUE) |
||||
|
|
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,5 @@ |
|||||
|
Name: Just The Facts |
||||
|
Description: Takes a URL on the clipboard and inserts/executes a call to `just_the_facts()` |
||||
|
that includes "printing" the object which launches a browser with the API call result |
||||
|
Binding: jtf_addin |
||||
|
Interactive: false |
@ -0,0 +1,11 @@ |
|||||
|
% Generated by roxygen2: do not edit by hand |
||||
|
% Please edit documentation in R/jtf_addin.R |
||||
|
\name{jtf_addin} |
||||
|
\alias{jtf_addin} |
||||
|
\title{Take URL from clipboard and get the facts!} |
||||
|
\usage{ |
||||
|
jtf_addin() |
||||
|
} |
||||
|
\description{ |
||||
|
Take URL from clipboard and get the facts! |
||||
|
} |
Loading…
Reference in new issue