Last active
August 14, 2019 07:20
-
-
Save mrchypark/b709117a7b9be0ebfcdc2b620d50cca0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(httr) | |
library(dplyr) | |
library(purrr) | |
library(writexl) | |
tar <- "https://kreditjob.com/api/dashboard/filter" | |
body <- list("bjd_code"= F, | |
"data_ym"= "1903", | |
"industry"= F, | |
"max_prsn"= F, | |
"max_prsn_ratio"= F, | |
"max_salary"= F, | |
"max_sales"= F, | |
"min_prsn"= F, | |
"min_prsn_ratio"= F, | |
"min_salary"= F, | |
"min_sales"= F, | |
"only_good_cmpn"= F, | |
"order"= "DESC", | |
"page"= 1, | |
"size"= 5, | |
"sort"="SALES_VALUE") | |
POST(tar, body = body, encode = "json") %>% | |
content() %>% | |
with(total_count) -> | |
cnt | |
size <- 1000 | |
1:(as.integer(cnt/size)+1) %>% | |
map( | |
~ list( | |
"bjd_code" = F, | |
"data_ym" = "1903", | |
"industry" = F, | |
"max_prsn" = F, | |
"max_prsn_ratio" = F, | |
"max_salary" = F, | |
"max_sales" = F, | |
"min_prsn" = F, | |
"min_prsn_ratio" = F, | |
"min_salary" = F, | |
"min_sales" = F, | |
"only_good_cmpn" = F, | |
"order" = "DESC", | |
"page" = .x, | |
"size" = size, | |
"sort" = "SALES_VALUE" | |
) | |
) %>% | |
map_dfr( | |
~ POST(tar, body = .x, encode = "json") %>% | |
content() %>% | |
with(list) %>% | |
map_dfr(~ as_tibble(.x) %>% | |
when(.$OPEN_YN == "0" ~ tibble(), | |
~ .)) | |
) -> | |
krdj | |
write_xlsx(krdj, "krdj.xlsx") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
👍