Skip to content

Commit dbba62c

Browse files
authored
Merge pull request #65 from kbroman/cran
Package had stopped working
2 parents f664b1e + db186f0 commit dbba62c

File tree

9 files changed

+35
-21
lines changed

9 files changed

+35
-21
lines changed

.github/workflows/R-CMD-check.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
33
on:
44
push:
5-
branches: [main, master]
5+
branches: [main, master, cran]
66
pull_request:
7-
branches: [main, master]
87

9-
name: R-CMD-check
8+
name: R-CMD-check.yaml
9+
10+
permissions: read-all
1011

1112
jobs:
1213
R-CMD-check:
@@ -29,7 +30,7 @@ jobs:
2930
R_KEEP_PKG_SOURCE: yes
3031

3132
steps:
32-
- uses: actions/checkout@v3
33+
- uses: actions/checkout@v4
3334

3435
- uses: r-lib/actions/setup-pandoc@v2
3536

@@ -47,3 +48,4 @@ jobs:
4748
- uses: r-lib/actions/check-r-package@v2
4849
with:
4950
upload-snapshots: true
51+
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'

DESCRIPTION

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: aRxiv
22
Title: Interface to the arXiv API
3-
Version: 0.10
4-
Date: 2024-02-29
3+
Version: 0.12
4+
Date: 2025-07-29
55
Authors@R: c(person("Karthik", "Ram", role="aut",
66
email="karthik.ram@gmail.com", comment=c(ORCID = "0000-0002-0233-1757")),
77
person("Karl", "Broman", role=c("aut","cre"),
@@ -28,5 +28,5 @@ Suggests:
2828
VignetteBuilder: knitr
2929
Encoding: UTF-8
3030
LazyData: true
31-
RoxygenNote: 7.3.1
31+
RoxygenNote: 7.3.2
3232
Roxygen: list(markdown = TRUE)

NEWS.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
aRxiv 0.12
2+
----------
3+
4+
### BUG FIXES
5+
6+
* The package had totally stopped working. Got it working again by
7+
using `GET` rather than `POST`, and `query` rather than `body`.
8+
9+
* Fixed a typo in `arxiv_count()` that had been introduced way back in
10+
December, 2014.
11+
12+
113
aRxiv 0.10
214
----------
315

R/arxiv_count.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ function(query=NULL, id_list=NULL)
4747
# (extra messy to avoid possible problems when testing on CRAN
4848
# timeout_action defined in timeout.R)
4949
body <- list(search_query=query, id_list=id_list,
50-
start=0, max_gresults=0)
50+
start=0, max_results=0)
5151
body <- drop_nulls(body)
52-
search_result <- try(httr::POST(query_url,
53-
body=body,
52+
search_result <- try(httr::GET(query_url,
53+
query=body,
5454
httr::timeout(get_arxiv_timeout())))
5555
if(inherits(search_result, "try-error")) {
5656
timeout_action()

R/arxiv_search.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ function(query=NULL, id_list=NULL, start=0, limit=10,
138138
start=start, max_results=limit,
139139
sortBy=recode_sortby(sort_by), sortOrder=sort_order)
140140
body <- drop_nulls(body)
141-
search_result <- try(httr::POST(query_url,
142-
body=body,
141+
search_result <- try(httr::GET(query_url,
142+
query=body,
143143
httr::timeout(get_arxiv_timeout())))
144144
if(inherits(search_result, "try-error")) {
145145
timeout_action()

R/can_arxiv_connect.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ can_arxiv_connect <-
1818
{
1919
query_url <- "http://export.arxiv.org/api/query"
2020

21-
result <- tryCatch(z <- httr::POST(query_url, body=list(search_query="all:electron", max_results=0),
21+
result <- tryCatch(z <- httr::GET(query_url, query=list(search_query="all:electron", max_results=0),
2222
httr::timeout(max_time)),
2323
error=function(e) paste("Failure to connect in arxiv_check"))
2424

25-
# check for error in httr::POST
25+
# check for error in httr::GET
2626
if(!is.null(result) && length(result)==1 &&
2727
result == "Failure to connect in arxiv_check") {
2828
warning("Failed to connect to ", query_url, " in ", max_time, " sec")

tests/testthat/test-arxiv_errors.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ test_that("arxiv_error_message gives right info", {
1313
query_url <- "http://export.arxiv.org/api/query"
1414

1515
delay_if_necessary()
16-
good <- POST(query_url, body=list(id_list="1403.3048,1402.2633,1309.1192"))
16+
good <- GET(query_url, query=list(id_list="1403.3048,1402.2633,1309.1192"))
1717
good <- result2list(good)
1818
expect_null(arxiv_error_message(good))
1919

2020
delay_if_necessary()
21-
bad <- POST(query_url, body=list(id_list="1403.3048,1402.2633,1309.119"))
21+
bad <- GET(query_url, query=list(id_list="1403.3048,1402.2633,1309.119"))
2222
bad <- result2list(bad)
2323
expect_equal(arxiv_error_message(bad), "incorrect id format for 1309.119")
2424

tests/testthat/test-clean.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ if(!on_cran) {
1717
query_url <- "http://export.arxiv.org/api/query"
1818
delay_if_necessary()
1919

20-
z <- httr::POST(query_url, body=list(search_query=query,
20+
z <- httr::GET(query_url, query=list(search_query=query,
2121
start=0, max_results=20,
2222
sort_by="submitted"))
2323
z <- get_entries(result2list(z))
@@ -74,7 +74,7 @@ test_that("clean_links works right", {
7474

7575
# manuscript with multiple DOI links
7676
delay_if_necessary()
77-
zz <- POST(query_url, body=list(id_list="1206.1585v3",
77+
zz <- GET(query_url, query=list(id_list="1206.1585v3",
7878
start=0, max_results=1))
7979
zz <- get_entries(result2list(zz))
8080

@@ -100,7 +100,7 @@ test_that("clean_categories works right", {
100100

101101
# manuscript with 6 categories
102102
delay_if_necessary()
103-
zz <- POST(query_url, body=list(id_list="1303.5613v1",
103+
zz <- GET(query_url, query=list(id_list="1303.5613v1",
104104
start=0, max_results=1))
105105
zz <- get_entries(result2list(zz))
106106

vignettes/aRxiv.Rmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,8 +263,8 @@ A few short notes:
263263
(e.g., `stat.AP`) but also codes for the
264264
[Mathematical Subject Classification (MSC)](https://mathscinet.ams.org/mathscinet/msc/msc2010.html) (e.g., 14J60)
265265
and the
266-
[ACM Computing Classification System](https://www.acm.org/publications/class-2012)
267-
(e.g., F.2.2). These are not searchable with `cat:` but are
266+
ACM Computing Classification System
267+
(e.g., F.2.2, see `www.acm.org/publications/class-2012`). These are not searchable with `cat:` but are
268268
searchable with a general search.
269269

270270
```{r search_msc}

0 commit comments

Comments
 (0)