PageSourceSearch

https://www.iweathernet.com/js/tools/currentconditionswidget.js

js iweathernet.com collected 2026-10-02 06:43:13 UTC 8,063 bytes, 1 lines download raw bytes

1//production��iWeatherNet.loadScript("/js/common/mustache.js");�iWeatherNet.loadScript("/js/common/deferreds.js");����//dev�/*�iWeatherNet.loadScript("../common/js/deferreds.js");�iWeatherNet.loadScript("../common/js/mustache.js");�debugenabled=true;�*/��var devkey='client_id=dBSN9JcljtWikpEDm597f&client_secret=ZIsGKXgBUbd9EiNyZcEx1OtiyuWQPujaGv1v4h3G';�var prodkey='client_id=dBSN9JcljtWikpEDm597f&client_secret=ZIsGKXgBUbd9EiNyZcEx1OtiyuWQPujaGv1v4h3G';��if (window.location.host.toLowerCase().indexOf("iweathernet.com")>-1){�iWeatherNet.aerisKey=prodkey;�}�else�{�iWeatherNet.aerisKey=devkey;�}������/*�config object definition:�{�	station:"DFW",�	spanTemp:"spanPutTempHere",�	spanPressure:"spanPutPressureHere"�}�*/�����iWeatherNet.getAerisCurrentConditions=function(station){�	// STATION REQUIRES THE K�	�	var thisDeferred=new iWeatherNet.deferred("getAerisCurrentConditions",15);�	if (iWeatherNet.aerisCurrentConditions){thisDeferred.resolve();return thisDeferred;}�	var dt=iWeatherNet.ISOdateTime((new Date()).toISOString());�	��	�	var params={�		key:iWeatherNet.aerisKey,�		station:station,�		sort:"",�		/*limit:config.limit.toString(),*/�		r:parseInt(Math.random()*10000),�		dt:dt.thisTZ.prettyDate�	};�	�	�	�	/*var query1=Mustache.render("?p={{{station}}}&limit=20&plimit=2&from=-2hours",params);�	var query2=Mustache.render("?p={{{station}}}&limit=20&plimit=3&from=-24hours&to=2hours",params);�	*/�	�	var query3=Mustache.render("?p={{{station}}}&plimit=5",params); //observations/recent from getCurrent and getCurrentAll�	var query4=Mustache.render("?p={{{station}}}&from=yesterday&plimit=5",params); //observations/recent (yesterday) from getCurrentAll�	var query5=Mustache.render("?p={{{station}}}&from={{{dt}}}&plimit=50",params); //�	�	var url="https://api.aerisapi.com/batch/?" + iWeatherNet.aerisKey + "&requests=";�		url+="/observations/recent" + encodeURIComponent(query3);�		url+=",/observations/recent" + encodeURIComponent(query4);�		//url+=",/observations/recent" + encodeURIComponent(query5);�		�	//console.log(url);�	�	jQuery.ajax({�		url: url,�		dataType: "json",�		success: function(json) {�			condir(json);�			iWeatherNet.aerisCurrentConditions=json.response.responses;�			thisDeferred.resolve();�			�		}�	});��	return thisDeferred;�	�}���iWeatherNet.getCurrent=function(config){�	urlParameters={station:config.station,key:iWeatherNet.aerisKey};�	jQuery.when(iWeatherNet.getAerisCurrentConditions("k" + urlParameters.station)).done(�		function(){�		�		var responsedata=iWeatherNet.aerisCurrentConditions[0];�		//condir(responsedata);�			�		�			if (responsedata.error&&responsedata.error.code=="warn_no_data")�			{�				var responsedata=iWeatherNet.aerisCurrentConditions[1];�			}�			�			condir(responsedata);�			try{�				var theTemp="0";�				var press=responsedata.response.periods[0].ob.pressureIN;�				//var press=responsedata.current_observation.pressure_in;�				�				theTemp=responsedata.response.periods[0].ob.tempF.toString() + "&deg;F";�				//theTemp=responsedata.current_observation.temp_f.toString() + "&deg;F";�				�				var thePressure=responsedata.response.periods[0].ob.pressureMB.toString() + "mb / " + press.toString() + "in";�				//var thePressure=responsedata.current_observation.pressure_mb + "mb / " + press.toString() + "in";�				�				iWeatherNet.gaugeData.tempF=responsedata.response.periods[0].ob.tempF;�			}�			catch(E){condir(E);}�			�			jQuery(Q(config.spanTemp)).html(theTemp?theTemp:"Unknown");�			if (config.spanPressure){�				jQuery(Q(config.spanPressure)).html(thePressure?thePressure:"Unknown");�			}�			�		//}�	}�	);�	�	�}���function Q(inbound){�	//check for # or . if not found, send back # prepended�	try{�		var re=/^\.|^\#/;�		if (re.test(inbound)){�			return inbound;�		}�		else�		{�			return "#" + inbound;�		}�		�	}�	catch(E){�		return inbound;�	}�}���iWeatherNet.getCurrentAll=function(config){��	/*�		takes a series of field names from the JSON and inserts them into the specified spans�		config object:�		{�			station:"DFW",�			data:[�				["tempF","spanTemp"],�				["dateTimeISO","spanDateTimeISO"],�				["weather","spanWeather"],�				["dewpointF","spanDewPoint"],�				["humidity","spanHumidity"],�				["windMPH","spanWind"],�				["windDir","spanWindDir"],�				["pressureIN","spanPressureIN"]�			]�		}�	�	*/�	�	urlParameters={station:config.station,key:iWeatherNet.aerisKey};�	�	jQuery.when(iWeatherNet.getAerisCurrentConditions("k" + urlParameters.station)).done(�		function(){�		�		var responsedata=iWeatherNet.aerisCurrentConditions[0];�		condir(responsedata);�		�			if (responsedata.error&&responsedata.error.code=="warn_no_data")�			{�				var responsedata=iWeatherNet.aerisCurrentConditions[1];�			}�			//condir(responsedata);�			try{�				jQuery.each(config.data,function(i,item){�					//console.dir(item);�					//jQuery("#" + item[1]).html(responsedata.response.periods[0].ob[item[0]]);�					switch(item[0]){�						case "pressureIN":�							var press="";�							if (responsedata.response.periods[0].ob[item[0]]){�								press=responsedata.response.periods[0].ob[item[0]].toFixed(2);�							}�							else�							{�								press="N/A";�							}�							jQuery(Q(item[1])).html(press);�							break;�						case "tempChange1Hour":�							var currentTemp=responsedata.response.periods[0].ob.tempF;�							var currentObTime=responsedata.response.periods[0].ob.timestamp;�							for(var z=1;z<=5;z++){�								//console.log(z);�								if (!responsedata.response.periods[z]){jQuery("#" + item[1]).html("N/A"); break;}�								//console.log(responsedata.response.periods[z].ob.timestamp-currentObTime);�								if (currentObTime-responsedata.response.periods[z].ob.timestamp>=3600){�									var diff=(currentTemp-responsedata.response.periods[z].ob.tempF).toString() + "&deg;F";�									jQuery(Q(item[1])).html(diff);�									break;//out of the loop�								}�							}//loop�							break;�						case "dateTimeISO":�							var dt=iWeatherNet.ISOdateTime(responsedata.response.periods[0].ob[item[0]]);�							condir(dt);�							//.dateTimeNoTZ=item.ob.dateTimeISO.substring(0,19);�							�							jQuery(Q(item[1])).html(dt.thisTZ.prettyTime);�							break;�						case "icon":�							jQuery(Q(item[1])).prop("src","https://www.iweathernet.com/images/icons/" + responsedata.response.periods[0].ob[item[0]]);�							break;�						case "windMPH":�							var wind=responsedata.response.periods[0].ob[item[0]];�							if (isNaN(wind)||wind==0){�								jQuery(Q(item[1])).html("Calm");�							}�							else�							{�								jQuery(Q(item[1])).html(responsedata.response.periods[0].ob.windDir + " at " + wind.toString() + " MPH");�							}�							break;�						case "windGustMPH":�							if (responsedata.response.periods[0].ob[item[0]]&&jQuery.isNumeric(responsedata.response.periods[0].ob[item[0]])){�								jQuery(Q(item[1])).html(" gusting to " + responsedata.response.periods[0].ob[item[0]].toString() + " MPH");�							}�							break;�						case "windchillF":�							conlog("windchillF");�							try{�								if (responsedata.response.periods[0].ob.tempF<45){�									var windchill=responsedata.response.periods[0].ob.windchillF.toString() + "&deg;F";�									�								}�								else�								{�									var windchill="negligbile or nonexistent";�								}�								�							}�							catch(E){�								var windchill="error";�							}�							jQuery(Q(item[1])).html(windchill);�							break;�						case "weather":�							try{�								responsedata.response.periods[0].ob.weather=responsedata.response.periods[0].ob.weather.replace("with Storms Likely","with thunderstorms");�							}�							catch(E){console.dir(E,"Error substituting for storms likely");}�							jQuery(Q(item[1])).html(responsedata.response.periods[0].ob[item[0]]);�							break;�								�						default:�							jQuery(Q(item[1])).html(responsedata.response.periods[0].ob[item[0]]);�							try{�								if (item[0]=="tempF"){�									iWeatherNet.gaugeData.tempF=responsedata.response.periods[0].ob[item[0]];�								}�							}�							catch(E){}�							�					}��				});�			}
1�			catch(E){condir(E);}��			�			�			�		//}�	}�	);�	�	�}���

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.