Skip to content

Commit

Permalink
fix: httr content to default; closes #19
Browse files Browse the repository at this point in the history
  • Loading branch information
kalab-oto committed Oct 28, 2023
1 parent edfcd4c commit d527768
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions R/ndop_search.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,19 @@ ndop_search <- function(search_payload){

Sys.sleep(3)

filter_page_cont <- httr::content(filter_page)

num_rec_ind <- gregexpr("záznam ze \\d+",
httr::content(filter_page,
"text"))
filter_page_cont)
num_rec <- as.numeric(
substring(
httr::content(filter_page, "text"),
filter_page_cont,
num_rec_ind[[1]][1] + 10,
num_rec_ind[[1]][1] + attr(num_rec_ind[[1]], "match.length")[1] - 1)
)
ndtoken_ind <- gregexpr("ndtoken=\\w", httr::content(filter_page, "text"))
ndtoken_ind <- gregexpr("ndtoken=\\w", filter_page_cont)
ndtoken <- substring(
httr::content(filter_page, "text"),
filter_page_cont,
ndtoken_ind[[1]][1] + 8,
ndtoken_ind[[1]][1] + attr(ndtoken_ind[[1]], "match.length")[1] + 30)
filter_session_info <- list(records = num_rec,
Expand Down

0 comments on commit d527768

Please sign in to comment.