// Require moment.js (with locales) function Get(yourUrl){ var Httpreq = new XMLHttpRequest(); Httpreq.open("GET",yourUrl,false); Httpreq.send(null); return Httpreq.responseText; } var json_obj = JSON.parse(Get("https://golem.linux.it/cgi/zerocalcare/main.py?interval=4weeks")); console.log("this is the JSON: "+JSON.stringify(json_obj)); moment.locale('it'); for (i in json_obj) { var time_str; var date = moment(json_obj[i]["DATETIME"]) console.log(JSON.stringify(json_obj[i])); document.write('
'+json_obj[i]["NAME"]+'
'); document.write("
📅 "+date.format("ddd D MMMM")+"
"); if (json_obj[i]["ALLDAY"] == true) time_str = "Tutto il giorno" else time_str = date.format("H:mm") document.write("
⏰ "+time_str+"
"); // Probably is better to get a default location from Python? if ("LOCATION" in json_obj[i] && json_obj[i]["LOCATION"] != '' ) document.write("
📍 "+json_obj[i]["LOCATION"]+"
"); else document.write("
📍 Officina Informatica
"); }