Skip to content

Commit

Permalink
Use different endpoint for cran_package_history()
Browse files Browse the repository at this point in the history
Hopefully it helps with #117.

I have no clue why CloudFlare returns 400 for the
repeated requests for the other endpoint,
and with their free tier I can't seem to be able
to dig deeper in the logs.

Nevertheless this entpoint seems to work better.

We can't easily turn off Cloudflare right now, we
would need to update the crandb server for that.
  • Loading branch information
gaborcsardi committed Jul 31, 2023
1 parent 760be97 commit 2d0762b
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions R/crandb-public-api.R
Original file line number Diff line number Diff line change
Expand Up @@ -308,13 +308,10 @@ do_crandb_query <- function(from, limit,

cran_package_history <- function(package) {

resp <- do_crandb_query(
from = package, limit = 1,
format = "full",
archived = TRUE
)
ept <- paste0(package, "/all")
resp <- crandb_query(ept)

df_list <- lapply(resp, function(p) rectangle_packages(p$versions))
df_list <- list(rectangle_packages(resp$versions))
df_list <- make_col_compatible(df_list)
res <- do.call("rbind", df_list)

Expand Down

0 comments on commit 2d0762b

Please sign in to comment.