Skip to content

Commit

Permalink
Council API discontinued
Browse files Browse the repository at this point in the history
  • Loading branch information
michalovadek committed Jun 8, 2024
1 parent dffc72b commit 8c3f99e
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 24 deletions.
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# eurlex 0.5.0

## Major changes
- the Council votes API was discontinued in May 2024. Hopefully there is a new one to replace it soon

# eurlex 0.4.7

## Minor changes
Expand Down
50 changes: 26 additions & 24 deletions R/elx_council_votes.R
Original file line number Diff line number Diff line change
Expand Up @@ -90,29 +90,31 @@ elx_council_votes <- function(){
ORDER BY DESC(?decisionDate), ?votingInstCode
"

# run query
votes_resp <- graceful_http(
remote_file = "https://data.consilium.europa.eu/sparql",
body = list(query = query),
httr::content_type("multipart"),
headers = httr::add_headers('Accept' = 'text/csv'),
encode = "multipart",
verb = "POST"
)

# if var not created, break
if (is.null(votes_resp)){

return(invisible(NULL))

}

# process response
votes <- votes_resp %>%
httr::content("text") %>%
readr::read_csv(col_types = readr::cols(.default = "c"))

# return
return(votes)
# # run query
# votes_resp <- graceful_http(
# remote_file = "https://data.consilium.europa.eu/sparql",
# body = list(query = query),
# httr::content_type("multipart"),
# headers = httr::add_headers('Accept' = 'text/csv'),
# encode = "multipart",
# verb = "POST"
# )
#
# # if var not created, break
# if (is.null(votes_resp)){
#
# return(invisible(NULL))
#
# }
#
# # process response
# votes <- votes_resp %>%
# httr::content("text") %>%
# readr::read_csv(col_types = readr::cols(.default = "c"))
#
# # return
# return(votes)

return("The Council votes API was discontinued in May 2024.")

}

0 comments on commit 8c3f99e

Please sign in to comment.