mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
Download logging tweaks
This commit is contained in:
parent
0f1ab97444
commit
7332b6d1b3
1 changed files with 5 additions and 3 deletions
|
@ -1055,13 +1055,14 @@ function downloadJsonUrlToFile(url, callsignPath) {
|
||||||
|
|
||||||
https
|
https
|
||||||
.get(url, (res) => {
|
.get(url, (res) => {
|
||||||
console.log("statusCode:", res.statusCode);
|
//console.log("statusCode:", res.statusCode);
|
||||||
console.log("headers:", res.headers);
|
//console.log("headers:", res.headers);
|
||||||
|
|
||||||
res.on("data", (d) => {
|
res.on("data", (d) => {
|
||||||
console.log(d);
|
//console.log(d);
|
||||||
let json = JSON.parse(d);
|
let json = JSON.parse(d);
|
||||||
fs.writeFileSync(callsignPath, JSON.stringify(json, null, 2));
|
fs.writeFileSync(callsignPath, JSON.stringify(json, null, 2));
|
||||||
|
sysInfo.info("Download " + url +" return statuscode: " + res.statusCode);
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.on("error", (e) => {
|
.on("error", (e) => {
|
||||||
|
@ -1069,6 +1070,7 @@ function downloadJsonUrlToFile(url, callsignPath) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
function downloadCallsignReverseLookupData() {
|
function downloadCallsignReverseLookupData() {
|
||||||
|
sysInfo.info("Downloading callsigns.json");
|
||||||
var callsignPath = path.join(configFolder, "callsigns.json");
|
var callsignPath = path.join(configFolder, "callsigns.json");
|
||||||
downloadJsonUrlToFile(
|
downloadJsonUrlToFile(
|
||||||
"https://api.freedata.app/callsign_lookup.php",
|
"https://api.freedata.app/callsign_lookup.php",
|
||||||
|
|
Loading…
Reference in a new issue