Browse Source

cran check

master
boB Rudis 4 years ago
parent
commit
9c01fc09fe
No known key found for this signature in database GPG Key ID: 1D7529BE14E2BBA9
  1. 2
      DESCRIPTION
  2. 8
      R/longurl-package.r
  3. 1
      R/longurl.r
  4. 1
      README.Rmd
  5. 17
      README.md
  6. 17
      man/expand_urls.Rd
  7. 9
      man/longurl.Rd

2
DESCRIPTION

@ -22,4 +22,4 @@ Suggests:
tinytest
Imports:
httr
RoxygenNote: 6.0.1.9000
RoxygenNote: 7.1.0

8
R/longurl-package.r

@ -1,5 +1,13 @@
#' Tools expand vectors of short URLs into long URLs
#'
#' Tools are provided to expand vectors of short URLs into long 'URLs'.
#' No 'API' services are used, which may mean that this operates more slowly than
#' 'API' services do (since they usually cache results of expansions that every
#' user of the service requests). You can setup your own caching layer with the
#' 'memoise' package if you wish to have a speedup during single sessions or add
#' larger dependencies, such as 'Redis', to gain a longer-term performance boost
#' at the expense of added complexity.
#'
#' @name longurl
#' @docType package
#' @author Bob Rudis (bob@@rud.is)

1
R/longurl.r

@ -6,7 +6,6 @@ s_STATUS <- safely(httr::warn_for_status)
#' Pass in a vector of URLs (ostensibly "short" URLs) and receive
#' a data frame of the original URLs and expanded URLs
#'
#' @md
#' @param urls_to_expand character vector of URLs
#' @param warn show any warnings (API or otherwise) as messages
#' @param agent user agent to use (some sites switchup content based on user agents).

1
README.Rmd

@ -12,6 +12,7 @@ hrbrpkghelpr::stinking_badges()
```{r description, results='asis', echo=FALSE, cache=FALSE}
hrbrpkghelpr::yank_title_and_description()
```
## What's Inside The Tin
The following functions are implemented:

17
README.md

@ -5,7 +5,7 @@ developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.re
[![Signed
by](https://img.shields.io/badge/Keybase-Verified-brightgreen.svg)](https://keybase.io/hrbrmstr)
![Signed commit
%](https://img.shields.io/badge/Signed_Commits-17%25-lightgrey.svg)
%](https://img.shields.io/badge/Signed_Commits-100%25-lightgrey.svg)
[![Linux build
Status](https://travis-ci.org/hrbrmstr/longurl.svg?branch=master)](https://travis-ci.org/hrbrmstr/longurl)
[![Coverage
@ -30,8 +30,9 @@ than ‘API’ services do (since they usually cache results of expansions
that every user of the service requests). You can setup your own caching
layer with the ‘memoise’ package if you wish to have a speedup during
single sessions or add larger dependencies, such as ‘Redis’, to gain a
longer-term performance boost at the expense of added complexity. \#\#
What’s Inside The Tin
longer-term performance boost at the expense of added complexity.
## What’s Inside The Tin
The following functions are implemented:
@ -40,6 +41,12 @@ The following functions are implemented:
## Installation
``` r
install.packages("longurl", repos = c("https://cinc.rud.is", "https://cloud.r-project.org/"))
# or
remotes::install_git("https://git.rud.is/hrbrmstr/longurl.git")
# or
remotes::install_git("https://git.sr.ht/~hrbrmstr/longurl")
# or
remotes::install_gitlab("hrbrmstr/longurl")
# or
remotes::install_github("hrbrmstr/longurl")
@ -89,8 +96,8 @@ expand_urls(test_urls) %>%
| Lang | \# Files | (%) | LoC | (%) | Blank lines | (%) | \# Lines | (%) |
| :--- | -------: | --: | --: | ---: | ----------: | ---: | -------: | ---: |
| R | 4 | 0.8 | 110 | 0.84 | 20 | 0.56 | 44 | 0.62 |
| Rmd | 1 | 0.2 | 21 | 0.16 | 16 | 0.44 | 27 | 0.38 |
| R | 4 | 0.8 | 110 | 0.84 | 20 | 0.54 | 44 | 0.62 |
| Rmd | 1 | 0.2 | 21 | 0.16 | 17 | 0.46 | 27 | 0.38 |
## Code of Conduct

17
man/expand_urls.Rd

@ -4,8 +4,13 @@
\alias{expand_urls}
\title{Expand a vector of (short) URLs using}
\usage{
expand_urls(urls_to_expand, warn = TRUE, agent = "longurl-r-package",
seconds = 5, .progress = FALSE)
expand_urls(
urls_to_expand,
warn = TRUE,
agent = "longurl-r-package",
seconds = 5,
.progress = FALSE
)
}
\arguments{
\item{urls_to_expand}{character vector of URLs}
@ -13,16 +18,16 @@ expand_urls(urls_to_expand, warn = TRUE, agent = "longurl-r-package",
\item{warn}{show any warnings (API or otherwise) as messages}
\item{agent}{user agent to use (some sites switchup content based on user agents).
Defaults to "\code{longurl-r-package}".}
Defaults to "`longurl-r-package`".}
\item{seconds}{number of seconds to wait for a response until giving up. Cannot be <1ms.}
\item{.progress}{kept for legacy functionality but ignored}
}
\value{
a tibble/data frame with the orignial URLs in \code{orig_url}, expanded URLs in
\code{expanded_url} and the HTTP \code{status_code} of the expanded URL. Completely
invalid URLs result in a \code{NA} value for \code{expanded_url} & \code{status_code}.
a tibble/data frame with the orignial URLs in `orig_url`, expanded URLs in
`expanded_url` and the HTTP `status_code` of the expanded URL. Completely
invalid URLs result in a `NA` value for `expanded_url` & `status_code`.
}
\description{
Pass in a vector of URLs (ostensibly "short" URLs) and receive

9
man/longurl.Rd

@ -3,10 +3,15 @@
\docType{package}
\name{longurl}
\alias{longurl}
\alias{longurl-package}
\title{Tools expand vectors of short URLs into long URLs}
\description{
Tools expand vectors of short URLs into long URLs
Tools are provided to expand vectors of short URLs into long 'URLs'.
No 'API' services are used, which may mean that this operates more slowly than
'API' services do (since they usually cache results of expansions that every
user of the service requests). You can setup your own caching layer with the
'memoise' package if you wish to have a speedup during single sessions or add
larger dependencies, such as 'Redis', to gain a longer-term performance boost
at the expense of added complexity.
}
\author{
Bob Rudis (bob@rud.is)

Loading…
Cancel
Save