Commit d68a60e5 authored by aborruso's avatar aborruso

prima versione

parents
nome,url,descrizione
bid,https://openregio.it/statistiche/export/5/immobili/0/0/0/json,beni immonbili destinati
pig,https://openregio.it/statistiche/export_procedure/0/0/0/0/json,procedure in gestione
big,https://openregio.it/statistiche/export/1/immobili/0/0/0/json,beni immonbili in gestione
aig,https://openregio.it/statistiche/export/1/aziende/19/0/0/json,aziende in gestione
ad,https://openregio.it/statistiche/export/5/aziende/0/0/0/json,aziende destinate
[
{
"nome": "bid",
"url": "https://openregio.it/statistiche/export/5/immobili/0/0/0/json",
"descrizione": "beni immonbili destinati"
},
{
"nome": "pig",
"url": "https://openregio.it/statistiche/export_procedure/0/0/0/0/json",
"descrizione": "procedure in gestione"
},
{
"nome": "big",
"url": "https://openregio.it/statistiche/export/1/immobili/0/0/0/json",
"descrizione": "beni immonbili in gestione"
},
{
"nome": "aig",
"url": "https://openregio.it/statistiche/export/1/aziende/19/0/0/json",
"descrizione": "aziende in gestione"
},
{
"nome": "ad",
"url": "https://openregio.it/statistiche/export/5/aziende/0/0/0/json",
"descrizione": "aziende destinate"
}
]
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
#!/bin/bash
set -x
cartella=$(pwd)
dataoggi=$(date +%Y%m%d)
function contarighe() {
wc <$1 -l
}
contatore=$(jq <"$cartella"/config.json '.|length-1')
while [ $contatore -ge 0 ]; do
uri=$(jq -r <"$cartella"/config.json '.['"$contatore"'].url')
nome=$(jq -r <"$cartella"/config.json '.['"$contatore"'].nome')
let contatore=contatore-1
# scarico la risorsa in formato JSON
curl "$uri" | jq . >"$cartella"/download/"$dataoggi"_"$nome".json || exit 1
# la converto in CSV
in2csv <"$cartella"/download/"$dataoggi"_"$nome".json -f json >"$cartella"/download/"$dataoggi"_"$nome".csv
done
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment