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
| #!/usr/bin/Rscript | |
| if (!require(jsonlite, quietly = TRUE, warn.conflicts = FALSE)) { | |
| stop("This program requires the `jsonlite` package. Please install it by running `install.packages('jsonlite')` in R and then try again.") | |
| } | |
| args <- commandArgs(trailingOnly = TRUE) | |
| if (length(args) == 0) { | |
| input <- readLines(file("stdin")) |
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
| # baixe os dados | |
| curl http://dadosabertos.ibama.gov.br/dados/SIFISC/auto_infracao/auto_infracao/auto_infracao.html > autos.html | |
| # gere csv | |
| # (primeiro passo é quebrar as linhas, acelera o processamento) | |
| cat autos.html \ | |
| | sed -e 's|<\/tr>|\n|g' \ | |
| | sed -e 's/.*<thead\sbgcolor\=\"\#808080\">//' \ | |
| -e 's|\salign\=\"center\"||g' \ | |
| -e 's|<\/th>|\|\|\||g' \ |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer