![]() Numpad_index = GETLASTMODIFIEDARRAYINDEX() - 1 // Map in_Numpad to 0.9 MAKESTRING(out_TCP_TX$, "GET /v1/public/yql?q=select%%20*%%20from%%20weather.forecast%%20where%%20woeid%%20in%%20(select%%20woeid%%20from%%aces(1)%%20where%%20text='%s')%%20and%%20u='%s'&format=xml HTTP/1.1\nHost:\n\n", zip_code, param_Units) // The feed does not provide a Last-Modified header field and seems to ignore the If-Modified-Since header field. PRINT("ERROR in %s 'weather p': DNS Lookup Failed", GETSYMBOLINSTANCENAME()) ĮLSE IF(in_TCP_Status = 2) // TCP connection succeeded, request weather data. PRINT("ERROR in %s 'weather p': TCP Connection Failed", GETSYMBOLINSTANCENAME()) ĮLSE IF((in_TCP_Status = 4) || (in_TCP_Status = 5)) // Connection broken locally or remotely, wait until next update request.ĮLSE IF(in_TCP_Status = 7) // DNS lookup failed, wait one minute and retry. IF(in_TCP_Status = 3) // TCP connection failed, wait one minute and retry. Minutes = minutes + ATOI(RIGHT(tod, LEN(tod) - 2)) įUNCTION ConnectToServer(INTEGER wait_time) SIGNED_INTEGER_FUNCTION ATOSINew(STRING ascii_string) // Converts a STRING to a SIGNED_INTEGER. PRINT("XMLGetElementData() content: '%s'", content) Start_pos = element_start + 1 + name_len + 1 Īttributes = MID(xml_feed, start_pos, end_pos - start_pos) Ĭontent = MID(xml_feed, start_pos, end_pos - start_pos) IF(end_pos > element_start + 1 + name_len) MAKESTRING(element_tag, "", xml_feed, element_start + name_len) MAKESTRING(element_tag, "", element_names) ĮLSE IF(MID(xml_feed, find_pos + name_len + 1, 1) = " ")Įnd_pos = FIND(element_tag, xml_feed, start_pos) įind_pos = FIND(element_tag, xml_feed, start_pos) Įnd_pos = FIND("/>", xml_feed, start_pos) - 1 MAKESTRING(element_tag, " end_pos || find_pos = 0) ![]() INTEGER depth, deepest_element, find_pos, name_len įOR(deepest_element = 0 TO GETNUMARRAYROWS(element_names)) IF(FIND("", xml_feed, start_pos) - 1, FIND(" ", xml_feed, start_pos) - 1) įUNCTION XMLFindElement(STRING element_names, BYREF INTEGER breadth, STRING xml_feed, BYREF INTEGER start_pos, BYREF INTEGER end_pos) INTEGER_FUNCTION XMLRootEndTagFound(STRING xml_feed) PropSHORTDESCRIPTION = "Time to wait to set preset in hundredths of a second." #BEGIN_PARAMETER_PROPERTIES param_Hold_Time PropSHORTDESCRIPTION = "Temperature units as Fahrenheit or Celsius." PropSHORTDESCRIPTION = "ZIP Code for local weather report." #BEGIN_PARAMETER_PROPERTIES param_Local_ZIP_Code STRING_OUTPUT out_City, out_State, out_Country STRING_OUTPUT out_Sunrise_Text, out_Sunset_Text ĪNALOG_OUTPUT out_Sunrise, out_Sunset STRING_OUTPUT out_Humidity_Text, out_Pressure_Text STRING_OUTPUT out_Wind_Chill_Text, out_Wind_Speed_Text, out_Wind_Direction_Text, out_Wind_Full_Description ĪNALOG_OUTPUT out_Humidity, out_Pressure STRING_OUTPUT out_Tomorrow_High_Text, out_Tomorrow_Low_Text, out_Tomorrow_Forecast ĪNALOG_OUTPUT out_Wind_Chill, out_Wind_Speed, out_Wind_Direction STRING_OUTPUT out_Today_High_Text, out_Today_Low_Text, out_Today_Forecast ĪNALOG_OUTPUT out_Tomorrow_High, out_Tomorrow_Low, out_Tomorrow_Image STRING_OUTPUT out_Current_Temp_Text, out_Current_Conditions ĪNALOG_OUTPUT out_Today_High, out_Today_Low, out_Today_Image STRING_OUTPUT out_Preset_Location ĪNALOG_OUTPUT out_Current_Temp, out_Current_Image ![]() #DEFINE_CONSTANT #LOCATION_LEN 26 // LEN("Rancho Santa Margarita, CA")ĭIGITAL_INPUT in_Temperature_Sensor_Enable ĪNALOG_OUTPUT out_Lat_Degrees, out_Lat_Minutes ĪNALOG_OUTPUT out_Long_Degrees, out_Long_Minutes ĭIGITAL_INPUT in_Enter, in_Clear, in_Backspace ĭIGITAL_INPUT in_Preset #DEFINE_CONSTANT #BUFFER_LEN 10000 // #WEATHER_LEN * 2 Released by Adelyte Company into the public domain under the Creative Commons Zero license. #ENABLE_DYNAMIC // Dynamic arrays are NOT used, but supposedly this directive improves memory allocation.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |