Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adattare script per feed RSS a IstatData #17

Open
aborruso opened this issue Nov 18, 2022 · 4 comments
Open

Adattare script per feed RSS a IstatData #17

aborruso opened this issue Nov 18, 2022 · 4 comments

Comments

@aborruso
Copy link
Contributor

No description provided.

aborruso added a commit that referenced this issue Nov 18, 2022
@aborruso
Copy link
Contributor Author

L'elennco dei dataset disponibili è qui

curl 'https://esploradati.istat.it/databrowserhub/nodes/1/catalog' \
  -H 'Accept: application/json, text/plain, */*' \
  -H 'Accept-Language: it-IT,en;q=0.9,it;q=0.8' \
  -H 'Authorization: undefined' \
  -H 'Connection: keep-alive' \
    -H 'Referer: https://esploradati.istat.it/databrowser/' \
  -H 'Sec-Fetch-Dest: empty' \
  -H 'Sec-Fetch-Mode: cors' \
  -H 'Sec-Fetch-Site: same-origin' \
  -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36' \
  -H 'UserLang: it' \
  -H 'sec-ch-ua: "Google Chrome";v="107", "Chromium";v="107", "Not=A?Brand";v="24"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'sec-ch-ua-platform: "Windows"' \
  --compressed

Output esempio https://gist.github.com/aborruso/d57cf2f11485492b3d623dbddf2dcfe7

@sandrokensan
Copy link

Solo a me capita che copiando il comando mi dia:

curl: (35) OpenSSL/3.0.8: error:0A000152:SSL routines::unsafe legacy renegotiation disabled ?

Pare che curl ma anche wget usi le librerie SSL nella versione 3.0 e il server dell'ISTAT non è aggionato da molto tempo per cui la rinegoziazione non va a buon fine:

curl/curl#8943

Da browser funziona senza errori ma da Curl anche se il comando sopra tenta di emulare il browser mi da il soprastante errore.

@aborruso
Copy link
Contributor Author

Solo a me capita che copiando il comando mi dia:

curl: (35) OpenSSL/3.0.8: error:0A000152:SSL routines::unsafe legacy renegotiation disabled ?

Ciao @sandrokensan ,
a me restituisce l'output corretto. La mia version di curl è la 7.87.0.

E mi funzionano senza problemi anche wget e httpie.

image

@sandrokensan
Copy link

Grazie per la veloce risposta.

Confermo che adesso funziona sia il curl soprastante che da linea di comando il:
$ wget https://esploradati.istat.it/databrowserhub/nodes/1/catalog

Stranamente ieri notte non mi funzionava. Invece provando dal mio server da PHP funzionava con:

$ch = curl_init(); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_VERBOSE, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_USERAGENT, $agent); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application/json')); $result=curl_exec($ch); //var_dump($result); echo $result;

Penso che anche semplifincando il curl sullo script non ci siano problemi, farò delle prove.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants