JavaLikeCalc.JavaScript
if(f_start) {
	transport = "Sockets.weather:api.openweathermap.org:80";
	APPID = "ba3444a90f0c5863879bdb495edf8989";	//MeeCast ID

	schedCurTrueTm = schedFCTrueTm = 1;
	current = new Object(), forecast = new Array();
}

tErr = "";

if(!(tr=SYS.Transport.outAt(transport)) || !tr.start(true))
	tErr = "1:"+tr("Output transport '%1' error.").replace("%1",transport);
else {
	//Requesting current day data
	if(!schedCur.length || schedCur == null || SYS.time() >= SYS.cron(schedCur,schedCurTrueTm)) {
		req = SYS.XMLNode("GET");
		req.setAttr("URI", "/data/2.5/weather?id="+city+"&mode=xml&units=metric&APPID="+APPID);
		if(!(tErr=tr.messIO(req,"HTTP")).toInt() && !(tErr=(respTree=SYS.XMLNode()).load(req.text())).toInt()) {
			schedCurTrueTm = SYS.time();
			current = new Object();
			current.city = respTree.childGet("city").attr("name");
			current.country = respTree.childGet("city").childGet("country").text();
			current.sunRise = respTree.childGet("city").childGet("sun").attr("rise");
			current.sunSet = respTree.childGet("city").childGet("sun").attr("set");
			current.tm = respTree.childGet("lastupdate").attr("value");
			current.t = respTree.childGet("temperature").attr("value");
			current.tMin = respTree.childGet("temperature").attr("min");
			current.tMax = respTree.childGet("temperature").attr("max");
			current.tFeel = respTree.childGet("feels_like").attr("value");
			current.h = respTree.childGet("humidity").attr("value");
			current.p = respTree.childGet("pressure").attr("value");
			current.windSpeed = respTree.childGet("wind").childGet("speed").attr("value");
			current.windDir = respTree.childGet("wind").childGet("direction").attr("code");
			current.windDirDeg = respTree.childGet("wind").childGet("direction").attr("value");
			current.symbol = respTree.childGet("weather").attr("icon");
			current.symbolNm = respTree.childGet("weather").attr("value");
		}
	}

	//Requesting forecast
	if(!schedFC.length || schedFC == null || SYS.time() >= SYS.cron(schedFC,schedFCTrueTm)) {
		req = SYS.XMLNode("GET");
		//Daily
		req.setAttr("URI", "/data/2.5/forecast/daily?id="+city+"&mode=xml&units=metric&cnt=10&APPID="+APPID);
		if(!tErr.toInt() && !(tErr=tr.messIO(req,"HTTP")).toInt() && !(tErr=(respTree=SYS.XMLNode()).load(req.text())).toInt()) {
			forecastN = respTree.childGet("forecast");
			forecast = new Array();
			for(iTm = 0; (timeN=forecastN.childGet("time",iTm)); iTm++) {
				forecast.push(dayO=new Object());
				dayO.tm = timeN.attr("day");
				dayO.sunRise = timeN.childGet("sun").attr("rise");
				dayO.sunSet = timeN.childGet("sun").attr("set");
				dayO.t = timeN.childGet("temperature").attr("day");
				dayO.tMin = timeN.childGet("temperature").attr("min");
				dayO.tMax = timeN.childGet("temperature").attr("max");
				dayO.tNight = timeN.childGet("temperature").attr("night");
				dayO.tEve = timeN.childGet("temperature").attr("eve");
				dayO.tMorn = timeN.childGet("temperature").attr("morn");
				dayO.tFeel = timeN.childGet("feels_like").attr("day");
				dayO.tFeelNight = timeN.childGet("feels_like").attr("night");
				dayO.tFeelEve = timeN.childGet("feels_like").attr("eve");
				dayO.tFeelMorn = timeN.childGet("feels_like").attr("morn");
				dayO.h = timeN.childGet("humidity").attr("value");
				dayO.p = timeN.childGet("pressure").attr("value");
				dayO.windSpeed = timeN.childGet("windSpeed").attr("mps");
				dayO.windDir = timeN.childGet("windDirection").attr("code");
				dayO.windDirDeg = timeN.childGet("windDirection").attr("deg");
				dayO.symbol = timeN.childGet("symbol").attr("var");
				dayO.symbolNm = timeN.childGet("symbol").attr("name");
			}

			//Per time
			req.clear(true).setAttr("URI", "/data/2.5/forecast?id="+city+"&mode=xml&units=metric&APPID="+APPID);
			if(forecast.length && !(tErr=tr.messIO(req,"HTTP")).toInt() && !(tErr=(respTree=SYS.XMLNode()).load(req.text())).toInt()) {
				forecastN = respTree.childGet("forecast");
				iDay = 0, dayO = forecast[iDay], dayO.times = forecastTimes = new Array();
				for(iTm = 0; (timeN=forecastN.childGet("time",iTm)); iTm++) {
					timeO = new Object();
					timeO.tmFrom = timeN.attr("from");
					timeO.tmTo = timeN.attr("to");
					timeO.t = timeN.childGet("temperature").attr("value");
					timeO.tMin = timeN.childGet("temperature").attr("min");
					timeO.tMax = timeN.childGet("temperature").attr("max");
					timeO.tFeel = timeN.childGet("feels_like").attr("value");
					timeO.h = timeN.childGet("humidity").attr("value");
					timeO.p = timeN.childGet("pressure").attr("value");
					timeO.windSpeed = timeN.childGet("windSpeed").attr("mps");
					timeO.windDir = timeN.childGet("windDirection").attr("code");
					timeO.windDirDeg = timeN.childGet("windDirection").attr("deg");
					timeO.symbol = timeN.childGet("symbol").attr("var");
					timeO.symbolNm = timeN.childGet("symbol").attr("name");

					while(SYS.strftime(SYS.strptimegm(timeO.tmFrom,"%Y-%m-%dT%H:%M:%S"),"%Y-%m-%d") != dayO.tm) {
							//timeO.tmFrom.indexOf(dayO.tm+"T") < 0) {
						iDay++;
						if(iDay >= forecast.length)	{ iDay = 0; break; }
						dayO = forecast[iDay], dayO.times = forecastTimes = new Array();
					}
					forecastTimes.push(timeO);
				}
				schedFCTrueTm = SYS.time();
			}
		}
	}
}

//Error set
if(!tErr.length)	tErr = "0";
if(tErr.toInt()) {
	if(tr != null && tr.start()) tr.start(false);
	if(f_err != tErr)
		SYS.messDebug("/WEATH/"+this.cfg("SHIFR"), tr("Error")+": "+tErr);
}
else {
	tVl = "";
	if(schedCur.length && schedCur != null)
		tVl += tr("Scheduled currents call")+" "+SYS.strftime(SYS.cron(schedCur,schedCurTrueTm))+". ";
	if(schedFC.length && schedFC != null)
		tVl += tr("Scheduled forecast call")+" "+SYS.strftime(SYS.cron(schedFC,schedFCTrueTm))+". ";
	if(tVl.length)	tErr += ": "+tVl;
}
f_err = tErr;