dmpe / urlshorteneR

R package for 2 URL shortening service :loudspeaker: Compatible with Bitly API v4
http://cran.r-project.org/package=urlshorteneR
Apache License 2.0
22 stars 7 forks source link

RStudio addins for url shortening #18

Closed andodet closed 4 years ago

andodet commented 4 years ago

First of all thanks for the package. I believe the tool has a good fit with Rstudio addins for url shortening, I have implemented couple addins that might help to use the package outside the scope of an R script or the console:

In order to make things a bit easier I had to wrap bitly_shorten_link as, unlike isgs_LinksExpand and vgd_LinksExpand(), it uses long_url to pass the url to shorten.

Dependencies added

No idea what's your policy on adding dependencies, this could be definitely implemented without {cli} (as it's just used to make things a bit prettier on the console).


Open to chat about how this can be improved/extended.

dmpe commented 4 years ago

Thank you I will take a look on this over the weekend. Please remind if not

andodet commented 4 years ago

No worries @dmpe, just added a little test for the clipboard utility. Couldn't find anything on how to test shiny gadgets. as they don't have the classic Shiny structure (app.R or ui.R/server.R).

dmpe commented 4 years ago

No idea what's your policy on adding dependencies

I dont have any policy on that. Today's world is about managing dependencies and using them, not about selectively saying this or that should not be done. Programming is about using dependencies to simplify one's life. But :+1: on asking.

Can you please see my proposed changes (ignore Rd, due to whitespaces & editorconfig) and check again. If it is then ok on your end, I am going to submit it to CRAN today.

https://builder.r-hub.io/status/urlshorteneR_1.3.0.tar.gz-dc2d9000405cad0cf32d18a5bd95f4f3 https://builder.r-hub.io/status/urlshorteneR_1.3.0.tar.gz-118f424c4ed9119352645e4eb1a77fe1 https://builder.r-hub.io/status/urlshorteneR_1.3.0.tar.gz-7ed0f7ab5804261171281665a89dc0b3

dmpe commented 4 years ago

Apropro, thank you for extending the functionality @andodet I am glad you liked it/use it.

codeclimate[bot] commented 4 years ago

Code Climate has analyzed commit 490b240e and detected 0 issues on this pull request.

View more on Code Climate.

andodet commented 4 years ago

LGTM, devtools::check(args = c("--as-cran") builds everything correctly and nothing funky has come up. Feel free to submit it to CRAN whenever you find the time.

Apropro, thank you for extending the functionality @andodet I am glad you liked it/use it.

No worries @dmpe, it's been a great excuse to refresh Shiny and RStudio addins.

CRAN check output

```sh ==> devtools::check(args = c('--as-cran')) Updating urlshorteneR documentation Loading urlshorteneR In order to use bitly functions, you first need to authenticate. For that execute 'bitly_auth()' in R console. Writing NAMESPACE Writing NAMESPACE ── Building ── urlshorteneR ── Setting env vars: ● CFLAGS : -Wall -pedantic -fdiagnostics-color=always ● CXXFLAGS : -Wall -pedantic -fdiagnostics-color=always ● CXX11FLAGS: -Wall -pedantic -fdiagnostics-color=always ────────────────────────────── ✓ checking for file ‘/home/anddt/code/study/urlshorteneR/DESCRIPTION’ (344ms) ─ preparing ‘urlshorteneR’: ✓ checking DESCRIPTION meta-information ... ─ installing the package to build vignettes ✓ creating vignettes (7s) ─ checking for LF line-endings in source and make files and shell scripts ─ checking for empty or unneeded directories ─ building ‘urlshorteneR_1.3.0.tar.gz’ ── Checking ── urlshorteneR ── Setting env vars: ● _R_CHECK_CRAN_INCOMING_USE_ASPELL_: TRUE ● _R_CHECK_CRAN_INCOMING_REMOTE_ : FALSE ● _R_CHECK_CRAN_INCOMING_ : FALSE ● _R_CHECK_FORCE_SUGGESTS_ : FALSE ● NOT_CRAN : true ── R CMD check ───────────────────────────────────────────────────────────────── ─ using log directory ‘/home/anddt/code/study/urlshorteneR.Rcheck’ ─ using R version 4.0.2 (2020-06-22) ─ using platform: x86_64-pc-linux-gnu (64-bit) ─ using session charset: UTF-8 ─ using options ‘--no-manual --as-cran’ ✓ checking for file ‘urlshorteneR/DESCRIPTION’ ─ checking extension type ... Package ─ this is package ‘urlshorteneR’ version ‘1.3.0’ ─ package encoding: UTF-8 ✓ checking package namespace information ✓ checking package dependencies (4.6s) ✓ checking if this is a source package ✓ checking if there is a namespace ✓ checking for executable files (350ms) N checking for hidden files and directories Found the following hidden files and directories: tests/testthat/.httr-oauth These were most likely included in error. See section ‘Package structure’ in the ‘Writing R Extensions’ manual. ✓ checking for portable file names ... ✓ checking for sufficient/correct file permissions ✓ checking whether package ‘urlshorteneR’ can be installed (4.8s) ✓ checking installed package size ✓ checking package directory ... N checking for future file timestamps (6s) unable to verify current time ✓ checking ‘build’ directory ✓ checking DESCRIPTION meta-information (359ms) ✓ checking top-level files ✓ checking for left-over files ✓ checking index information ... ✓ checking package subdirectories ... ✓ checking R files for non-ASCII characters ... ✓ checking R files for syntax errors ... ✓ checking whether the package can be loaded (533ms) ✓ checking whether the package can be loaded with stated dependencies (481ms) ✓ checking whether the package can be unloaded cleanly (480ms) ✓ checking whether the namespace can be loaded with stated dependencies (487ms) ✓ checking whether the namespace can be unloaded cleanly (538ms) ✓ checking loading without being on the library search path (529ms) ✓ checking dependencies in R code (1s) ✓ checking S3 generic/method consistency (1.4s) ✓ checking replacement functions (618ms) ✓ checking foreign function calls (748ms) ✓ checking R code for possible problems (4.8s) ✓ checking Rd files (380ms) ✓ checking Rd metadata ... ✓ checking Rd line widths ... ✓ checking Rd cross-references ... ✓ checking for missing documentation entries (526ms) ✓ checking for code/documentation mismatches (1.7s) ✓ checking Rd \usage sections (1.4s) ✓ checking Rd contents ... ✓ checking for unstated dependencies in examples ... ✓ checking installed files from ‘inst/doc’ ... ✓ checking files in ‘vignettes’ ... ✓ checking examples (3.2s) ✓ checking for unstated dependencies in ‘tests’ ... ─ checking tests (356ms) ✓ Running ‘testthat.R’ (929ms) ✓ checking for unstated dependencies in vignettes (1.4s) ✓ checking package vignettes in ‘inst/doc’ ... ✓ checking re-building of vignette outputs (2.7s) ✓ checking for non-standard things in the check directory ✓ checking for detritus in the temp directory See ‘/home/anddt/code/study/urlshorteneR.Rcheck/00check.log’ for details. ── R CMD check results ───────────────────────────────── urlshorteneR 1.3.0 ──── Duration: 42.4s > checking for hidden files and directories ... NOTE Found the following hidden files and directories: tests/testthat/.httr-oauth These were most likely included in error. See section ‘Package structure’ in the ‘Writing R Extensions’ manual. > checking for future file timestamps ... NOTE unable to verify current time 0 errors ✓ | 0 warnings ✓ | 2 notes x R CMD check succeeded ```