duarteguilherme / congressbr

An R package that returns tidy data from the APIs of the Brazilian Federal Senate and Chamber of Deputies.
https://robertmyles.github.io/congressbr/
Other
43 stars 6 forks source link

sen_bills não funciona #56

Open MartinsRodrigo opened 2 years ago

MartinsRodrigo commented 2 years ago

Prezados, a função sen_bills está dando erro mesmo quando tento rodar o exemplo que vocês utilizam. A mensagem que aparece é a seguinte:

Erro: `.x` must be a list, not NULL
Run `rlang::last_error()` to see where the error occurred.
RobertMyles commented 2 years ago

Oi Rodrigo, tudo bem? Vi agora que não está funcionando mesmo:

> congressbr::sen_bills(bill_id = 2021)
Error: `.x` must be a list, not NULL
Run `rlang::last_error()` to see where the error occurred.
> httr::GET("https://legis.senado.gov.br/dadosabertos/materia/2021")
Response [https://legis.senado.gov.br/dadosabertos/materia/2021]
  Date: 2021-10-20 19:53
  Status: 200
  Content-Type: application/json;charset=UTF-8
  Size: 4.25 kB
{
    "DetalheMateria" : {
        "@xmlns:xsi" : "http://www.w3.org/2001/XMLSchema-instance",
        "@xsi:noNamespaceSchemaLocation" : "http://legis.senado.leg.br/dadosabertos...
        "Metadados" : {
            "Versao" : "20/10/2021 16:52:52",
            "VersaoServico" : "7",
            "DataVersaoServico" : "2021-09-14",
            "DescricaoDataSet" : "Detalhes da matéria. ATENÇÃO: para pesquisar requeri...
        },
...

Vou tentar achar o que mudou no API mas infelizmente não tenho muito tempo no momento para ajudar com isso. No enquanto, usando httr::GET("https://legis.senado.gov.br/dadosabertos/materia/2021") |> httr::content() vai te dar a informação numa lista, talvez seja util.