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
|
||||
.get(url, (res) => {
|
||||
console.log("statusCode:", res.statusCode);
|
||||
console.log("headers:", res.headers);
|
||||
//console.log("statusCode:", res.statusCode);
|
||||
//console.log("headers:", res.headers);
|
||||
|
||||
res.on("data", (d) => {
|
||||
console.log(d);
|
||||
//console.log(d);
|
||||
let json = JSON.parse(d);
|
||||
fs.writeFileSync(callsignPath, JSON.stringify(json, null, 2));
|
||||
sysInfo.info("Download " + url +" return statuscode: " + res.statusCode);
|
||||
});
|
||||
})
|
||||
.on("error", (e) => {
|
||||
|
@ -1069,6 +1070,7 @@ function downloadJsonUrlToFile(url, callsignPath) {
|
|||
});
|
||||
}
|
||||
function downloadCallsignReverseLookupData() {
|
||||
sysInfo.info("Downloading callsigns.json");
|
||||
var callsignPath = path.join(configFolder, "callsigns.json");
|
||||
downloadJsonUrlToFile(
|
||||
"https://api.freedata.app/callsign_lookup.php",
|
||||
|
|
Loading…
Reference in a new issue