Weird Weather Issue

So I have this script based on Martin's weather gadget. When you click onthe temperature it should change between Fahrenheit and Celcius. The odd thing is after it goes from Fahrenheit  to celcius, when you click it again the Fahrenheit temperature and condition changes. I am not sure what is causing it. Can anyone help me? This is a very odd issue.

 

Code for weather 

Code: vbscript
  1. Dim location
  2. Dim tempunit
  3. Dim summary(5)
  4. Dim summarymessage
  5. Sub Object_OnScriptEnter
  6. <span> </span>summarymessage=""'(mouse over images to show summary)"
  7. <span> </span>Dim filestring, filesys, filetxt
  8. <span> </span>filestring = DesktopX.ExecutableDirectory &amp; "weather.ini"
  9.  
  10. <span> </span>Set filesys = CreateObject("Scripting.FileSystemObject")
  11.  
  12. <span> </span>If filesys.FileExists(filestring) Then
  13. <span> </span>firstrun = False
  14. <span> </span>Else
  15. <span> </span>firstrun = True
  16. <span> </span>End If
  17.  
  18. <span> </span>If firstrun = True Then
  19. <span> </span>Set WshNetwork = CreateObject("WScript.Network")
  20. <span> </span>UserName = WshNetwork.UserName
  21. <span> </span>Set UserName = Nothing
  22. <span> </span>Set WshNetwork = Nothing
  23. <span> </span>location = "06514"
  24. <span> </span>tempunit = "s"
  25.  
  26. <span> </span>Else
  27. <span> </span>Set filetxt = filesys.OpenTextFile(filestring)
  28. <span> </span>location = filetxt.ReadLine
  29. <span> </span>tempunit = filetxt.ReadLine
  30. <span> </span>filetxt.Close
  31. <span> </span>End If
  32.  
  33. <span> </span>Set filestring = Nothing
  34. <span> </span>Set filesys = Nothing
  35. <span> </span>Set filetxt = Nothing
  36. <span> </span>Set firstrun = Nothing
  37. <span> </span>Object.SetTimer 6001, 600000
  38. <span> </span>Object_OnTimer6001
  39. End Sub
  40.  
  41. Sub Object_OnScriptExit
  42. <span> </span>Dim filestring, filesys, filetxt, getname, path
  43. <span> </span>filestring = DesktopX.ExecutableDirectory &amp; "weather.ini"
  44. <span> </span>Set filesys = CreateObject("Scripting.FileSystemObject")
  45. <span> </span>Set filetxt = filesys.CreateTextFile(filestring, True)
  46. <span> </span>path = filesys.GetAbsolutePathName(filestring)
  47. <span> </span>getname = filesys.GetFileName(path)
  48. <span> </span>filetxt.Write(location &amp; vbNewLine &amp; tempunit)
  49. <span> </span>filetxt.Close
  50.  
  51. <span> </span>Set filestring = Nothing
  52. <span> </span>Set filesys = Nothing
  53. <span> </span>Set filetxt = Nothing
  54. <span> </span>Set path = Nothing
  55. <span> </span>Set getname = Nothing
  56. End Sub
  57.  
  58. Sub Object_OnTimer6001
  59. <span> </span>If System.InternetConnected Then
  60. <span> </span>On Error Resume Next
  61. <span> </span>' Create a web object
  62. <span> </span>Set http = CreateObject("Microsoft.XmlHttp")
  63. <span> </span>' Retrieve data
  64. <span> </span>Randomize
  65. <span> </span>str_RANDOM_URL = "&amp;rnd=" &amp; rnd()
  66. <span> </span>If tempunit = "m" Then
  67. <span> </span>str_UNITS = "&amp;unit=m"
  68. <span> </span>Else
  69. <span> </span>str_UNITS = "&amp;unit=s"
  70.   <span> </span>End If
  71. <span> </span>http.Open "GET", "http://xoap.weather.com/weather/local/" &amp; location &amp; "?cc=*&amp;dayf=5" &amp; str_UNITS &amp; str_RANDOM_URL, False
  72. <span> </span>http.send ""
  73. <span> </span>' Store data in a string
  74. <span> </span>weatherdata = http.responseText
  75. <span> </span>
  76. <span> </span>If weatherdata &lt;&gt; "" Then
  77. <span> </span>' As the feed is XML it is nicely structured, and it makes sense to use a simple function to extract data father than string manipulation
  78. <span> </span>' Set the location using the xmlstrupper function (see below) to get the city and state
  79. <span> </span>weathertemp = xmlstripper("&lt;dnam&gt;", weatherdata)
  80. <span> </span>If weathertemp = "" Then
  81. <span> </span>Msgbox "This doesn't appear to be a valid zip code." &amp; vbNewLine &amp; vbNewLine &amp; "Please try again.", vbExclamation + vbOKOnly, "Zip error ..."
  82. <span> </span>x = InputBox("Please enter the zip code that you would like to display the weather for:", "Select zip code ...", "06514")
  83. <span> </span>location = x
  84. <span> </span>Object_OnTimer6001
  85. <span> </span>Exit Sub<span> </span>
  86. <span> </span>Else
  87. <span> </span>If IsNumeric(location) Then weathertemp = Left(weathertemp, InStr(weathertemp, "(")-2)
  88. <span> </span>'This is splitting the location into 2 lines<span> </span>
  89. <span> </span>tempstring = weathertemp
  90. <span> </span>firstpart = Left(tempstring, InStr(tempstring,",")-1)
  91. <span> </span>secondpart = Right(tempstring, Len(tempstring) - InStr(tempstring,",") - 1)
  92. <span> </span>
  93. <span> </span>DesktopX.ScriptObject("Weather City").Object.Text = firstpart &amp; ", " &amp; secondpart
  94. <span> </span>
  95. <span> </span>'Country Abbreviations ISO 3166 Jan 7 2007
  96. <span> </span>Select Case secondpart
  97. <span> </span>Case "Afghanistan" secondpart<span> </span>= "AFG"
  98. <span> </span>Case "Albania" secondpart = "ALB"
  99. <span> </span>Case "Algeria" secondpart = "DZA"
  100. <span> </span>Case "American Samoa" secondpart = "ASM"
  101. <span> </span>Case "Andorra" secondpart = "AND"
  102. <span> </span>Case "Angola" secondpart = "AGO"
  103. <span> </span>Case "Anguilla" secondpart = "AIA"
  104. <span> </span>Case "Antarctica" secondpart = "ATA"
  105. <span> </span>Case "Antigua And Barbuda" secondpart = "ATG"
  106. <span> </span>Case "Argentina" secondpart = "ARG"
  107. <span> </span>Case "Armenia" secondpart = "ARM"
  108. <span> </span>Case "Aruba" secondpart = "ABW"
  109. <span> </span>Case "Australia" secondpart = "AUS"
  110. <span> </span>Case "Austria" secondpart = "AUT"
  111. <span> </span>Case "Azerbaijan" secondpart = "AZE"
  112. <span> </span>Case "The Bahamas" secondpart = "BHS"
  113. <span> </span>Case "Bahrain" secondpart = "BHR"
  114. <span> </span>Case "Bangladesh" secondpart = "BGD"
  115. <span> </span>Case "Barbados" secondpart = "BRB"
  116. <span> </span>Case "Belarus" secondpart = "BLR"
  117. <span> </span>Case "Belgium" secondpart = "BEL"
  118. <span> </span>Case "Belize" secondpart = "BLZ"
  119. <span> </span>Case "Benin" secondpart = "BEN"
  120. <span> </span>Case "Bermuda" secondpart = "BMU"
  121. <span> </span>Case "Bhutan" secondpart = "BTN"
  122. <span> </span>Case "Bolivia" secondpart = "BOL"
  123. <span> </span>Case "Bosnia And Herzegovina" secondpart = "BIH"
  124. <span> </span>Case "Botswana" secondpart = "BWA"
  125. <span> </span>Case "Bouvet Island" secondpart = "BVT"
  126. <span> </span>Case "Brazil" secondpart = "BRA"
  127. <span> </span>Case "British Indian Ocean Territory (Chagos Archipelago)" secondpart = "IOT"
  128. <span> </span>Case "British Virgin Islands" secondpart = "VGB"
  129. <span> </span>Case "Brunei" secondpart = "BRN"
  130. <span> </span>Case "Bulgaria" secondpart = "BGR"
  131. <span> </span>Case "Burkina Faso" secondpart = "BFA"
  132. <span> </span>Case "Burundi" secondpart = "BDI"
  133. <span> </span>Case "Cambodia" secondpart = "KHM"
  134. <span> </span>Case "Cameroon" secondpart = "CMR"
  135. <span> </span>Case "Canada" secondpart = "CAN"
  136. <span> </span>Case "Cape Verde" secondpart = "CPV"
  137. <span> </span>Case "Cayman Islands" secondpart = "CYM"
  138. <span> </span>Case "Central African Republic" secondpart = "CAF"
  139. <span> </span>Case "Chad" secondpart = "TCD"
  140. <span> </span>Case "Chile" secondpart = "CHL"
  141. <span> </span>Case "China" secondpart = "CHN"
  142. <span> </span>Case "Christmas Island" secondpart = "CXR"
  143. <span> </span>Case "Cocos (Keeling) Islands" secondpart = "CCK"
  144. <span> </span>Case "Colombia" secondpart = "COL"
  145. <span> </span>Case "Comoros" secondpart = "COM"
  146. <span> </span>Case "Democratic Republic of The Congo" secondpart = "COD"
  147. <span> </span>Case "Republic of The Congo" secondpart = "COG"
  148. <span> </span>Case "Cook Islands" secondpart = "COK"
  149. <span> </span>Case "Costa Rica" secondpart = "CRI"
  150. <span> </span>Case "Cote D' Ivoire" secondpart = "CIV"
  151. <span> </span>Case "Cuba" secondpart = "CUB"
  152. <span> </span>Case "Cyprus" secondpart = "CYP"
  153. <span> </span>Case "Czech Republic" secondpart = "CZE"
  154. <span> </span>Case "Denmark" secondpart = "DNK"
  155. <span> </span>Case "Djibouti" secondpart = "DJI"
  156. <span> </span>Case "Dominicaf" secondpart = "DMA"
  157. <span> </span>Case "Dominican Republic" secondpart = "DOM"
  158. <span> </span>Case "Ecuador" secondpart = "ECU"
  159. <span> </span>Case "Egypt" secondpart = "EGY"
  160. <span> </span>Case "El Salvador" secondpart = "SLV"
  161. <span> </span>Case "Equatorial Guinea" secondpart = "GNQ"
  162. <span> </span>Case "Eritrea" secondpart = "ERI"
  163. <span> </span>Case "Estonia" secondpart = "EST"
  164. <span> </span>Case "Ethiopia" secondpart = "ETH"
  165. <span> </span>Case "Faeroe Islands" secondpart = "FRO"
  166. <span> </span>Case "Falkland Islands" secondpart = "FLK"
  167. <span> </span>Case "Fiji" secondpart = "FJI"
  168. <span> </span>Case "Finland" secondpart = "FIN"
  169. <span> </span>Case "France" secondpart = "FRA"
  170. <span> </span>Case "French Guiana" secondpart = "GUF"
  171. <span> </span>Case "French Polynesia" secondpart = "PYF"
  172. <span> </span>Case "French Southern Territories" secondpart = "ATF"
  173. <span> </span>Case "Gabon" secondpart = "GAB"
  174. <span> </span>Case "The Gambia" secondpart = "GMB"
  175. <span> </span>Case "Georgia" secondpart = "GEO"
  176. <span> </span>Case "Germany" secondpart = "DEU"
  177. <span> </span>Case "Ghana" secondpart = "GHA"
  178. <span> </span>Case "Gibraltar" secondpart = "GIB"
  179. <span> </span>Case "Greece" secondpart = "GRC"
  180. <span> </span>Case "Greenland" secondpart = "GRL"
  181. <span> </span>Case "Grenada" secondpart = "GRD"
  182. <span> </span>Case "Guadeloupe" secondpart = "GLP"
  183. <span> </span>Case "Guam" secondpart = "GUM"
  184. <span> </span>Case "Guatemala" secondpart = "GTM"
  185. <span> </span>Case "Guinea" secondpart = "GIN"
  186. <span> </span>Case "Guinea-bissau" secondpart = "GNB"
  187. <span> </span>Case "Guyana" secondpart = "GUY"
  188. <span> </span>Case "Haiti" secondpart = "HTI"
  189. <span> </span>Case "Heard And McDonald Islands" secondpart = "HMD"
  190. <span> </span>Case "Vatican City" secondpart = "VAT"
  191. <span> </span>Case "Honduras" secondpart = "HND"
  192. <span> </span>Case "Hong Kong" secondpart = "HKG"
  193. <span> </span>Case "Croatia" secondpart = "HRV"
  194. <span> </span>Case "Hungary" secondpart = "HUN"
  195. <span> </span>Case "Iceland" secondpart = "ISL"
  196. <span> </span>Case "India" secondpart = "IND"
  197. <span> </span>Case "Indonesia" secondpart = "IDN"
  198. <span> </span>Case "Iran" secondpart = "IRN"
  199. <span> </span>Case "Iraq" secondpart = "IRQ"
  200. <span> </span>Case "Ireland" secondpart = "IRL"
  201. <span> </span>Case "Israel" secondpart = "ISR"
  202. <span> </span>Case "Italy" secondpart = "ITA"
  203. <span> </span>Case "Jamaica" secondpart = "JAM"
  204. <span> </span>Case "Japan" secondpart = "JPN"
  205. <span> </span>Case "Jordan" secondpart = "JOR"
  206. <span> </span>Case "Kazakhstan" secondpart = "KAZ"
  207. <span> </span>Case "Kenya" secondpart = "KEN"
  208. <span> </span>Case "Kiribati" secondpart = "KIR"
  209. <span> </span>Case "North Korea" secondpart = "PRK"
  210. <span> </span>Case "South Korea" secondpart = "KOR"
  211. <span> </span>Case "Kuwait" secondpart = "KWT"
  212. <span> </span>Case "Kyrgyzstan" secondpart = "KGZ"
  213. <span> </span>Case "Laos" secondpart = "LAO"
  214. <span> </span>Case "Latvia" secondpart = "LVA"
  215. <span> </span>Case "Lebanon" secondpart = "LBN"
  216. <span> </span>Case "Lesotho" secondpart = "LSO"
  217. <span> </span>Case "Liberia" secondpart = "LBR"
  218. <span> </span>Case "Libya" secondpart = "LBY"
  219. <span> </span>Case "Liechtenstein" secondpart = "LIE"
  220. <span> </span>Case "Lithuania" secondpart = "LTU"
  221. <span> </span>Case "Luxembourg" secondpart = "LUX"
  222. <span> </span>Case "Macao" secondpart = "MAC"
  223. <span> </span>Case "Former Yugoslav Rep. of Macedonia" secondpart = "MKD"
  224. <span> </span>Case "Madagascar" secondpart = "MDG"
  225. <span> </span>Case "Malawi" secondpart = "MWI"
  226. <span> </span>Case "Malaysia" secondpart = "MYS"
  227. <span> </span>Case "Maldives" secondpart = "MDV"
  228. <span> </span>Case "Mali" secondpart = "MLI"
  229. <span> </span>Case "Malta" secondpart = "MLT"
  230. <span> </span>Case "Marshall Islands" secondpart = "MHL"
  231. <span> </span>Case "Martinique" secondpart = "MTQ"
  232. <span> </span>Case "Mauritania" secondpart = "MRT"
  233. <span> </span>Case "Mauritius" secondpart = "MUS"
  234. <span> </span>Case "Mayotte" secondpart = "MYT"
  235. <span> </span>Case "Mexico" secondpart = "MEX"
  236. <span> </span>Case "Federated States Of Micronesia" secondpart = "FSM"
  237. <span> </span>Case "Moldova" secondpart = "MDA"
  238. <span> </span>Case "Monaco" secondpart = "MCO"
  239. <span> </span>Case "Mongolia" secondpart = "MNG"
  240. <span> </span>Case "Montserrat" secondpart = "MSR"
  241. <span> </span>Case "Morocco" secondpart = "MAR"
  242. <span> </span>Case "Mozambique" secondpart = "MOZ"
  243. <span> </span>Case "Burma" secondpart = "MMR"
  244. <span> </span>Case "Namibia" secondpart = "NAM"
  245. <span> </span>Case "Nauru" secondpart = "NRU"
  246. <span> </span>Case "Nepal" secondpart = "NPL"
  247. <span> </span>Case "Netherlands Antilles" secondpart = "ANT"
  248. <span> </span>Case "Netherlands" secondpart = "NLD"
  249. <span> </span>Case "New Caledonia" secondpart = "NCL"
  250. <span> </span>Case "New Zealand" secondpart = "NZL"
  251. <span> </span>Case "Nicaragua" secondpart = "NIC"
  252. <span> </span>Case "Niger" secondpart = "NER"
  253. <span> </span>Case "Nigeria" secondpart = "NGA"
  254. <span> </span>Case "Niue, Republic of" secondpart = "NIU"
  255. <span> </span>Case "Norfolk Island" secondpart = "NFK"
  256. <span> </span>Case "Northern Mariana Islands" secondpart = "MNP"
  257. <span> </span>Case "Norway" secondpart = "NOR"
  258. <span> </span>Case "Oman" secondpart = "OMN"
  259. <span> </span>Case "Pakistan" secondpart = "PAK"
  260. <span> </span>Case "Palau" secondpart = "PLW"
  261. <span> </span>Case "West Bank" secondpart = "PSE"
  262. <span> </span>Case "Panama" secondpart = "PAN"
  263. <span> </span>Case "Papua New Guinea" secondpart = "PNG"
  264. <span> </span>Case "Paraguay" secondpart = "PRY"
  265. <span> </span>Case "Peru" secondpart = "PER"
  266. <span> </span>Case "Philippines" secondpart = "PHL"
  267. <span> </span>Case "Pitcairn Island" secondpart = "PCN"
  268. <span> </span>Case "Poland" secondpart = "POL"
  269. <span> </span>Case "Portugal" secondpart = "PRT"
  270. <span> </span>Case "Puerto Rico" secondpart = "PRI"
  271. <span> </span>Case "Qatar" secondpart = "QAT"
  272. <span> </span>Case "Reunion" secondpart = "REU"
  273. <span> </span>Case "Romania" secondpart = "ROU"
  274. <span> </span>Case "Russia" secondpart = "RUS"
  275. <span> </span>Case "Rwanda" secondpart = "RWA"
  276. <span> </span>Case "St. Helena" secondpart = "SHN"
  277. <span> </span>Case "St. Kitts And Nevis" secondpart = "KNA"
  278. <span> </span>Case "Saint Lucia" secondpart = "LCA"
  279. <span> </span>Case "St. Pierre And Miquelon" secondpart = "SPM"
  280. <span> </span>Case "St. Vincent And the Grenadines" secondpart = "VCT"
  281. <span> </span>Case "Samoa" secondpart = "WSM"
  282. <span> </span>Case "San Marino" secondpart = "SMR"
  283. <span> </span>Case "Sao Tome and Principe" secondpart = "STP"
  284. <span> </span>Case "Saudi Arabia" secondpart = "SAU"
  285. <span> </span>Case "Senegal" secondpart = "SEN"
  286. <span> </span>Case "Serbia And Montenegro" secondpart = "SCG"
  287. <span> </span>Case "Seychelles" secondpart = "SYC"
  288. <span> </span>Case "Sierra Leone" secondpart = "SLE"
  289. <span> </span>Case "Singapore" secondpart = "SGP"
  290. <span> </span>Case "Slovakia" secondpart = "SVK"
  291. <span> </span>Case "Slovenia" secondpart = "SVN"
  292. <span> </span>Case "Solomon Islands" secondpart = "SLB"
  293. <span> </span>Case "Somalia" secondpart = "SOM"
  294. <span> </span>Case "South Africa" secondpart = "ZAF"
  295. <span> </span>Case "South Georgia And the South Sandwich Islands" secondpart = "SGS"
  296. <span> </span>Case "Spain" secondpart = "ESP"
  297. <span> </span>Case "Sri Lanka" secondpart = "LKA"
  298. <span> </span>Case "Sudan" secondpart = "SDN"
  299. <span> </span>Case "Suriname" secondpart = "SUR"
  300. <span> </span>Case "Svalbard &amp; Jan Mayen Islands" secondpart = "SJM"
  301. <span> </span>Case "Swaziland" secondpart = "SWZ"
  302. <span> </span>Case "Sweden" secondpart = "SWE"
  303. <span> </span>Case "Switzerland" secondpart = "CHE"
  304. <span> </span>Case "Syria" secondpart = "SYR"
  305. <span> </span>Case "Taiwan" secondpart = "TWN"
  306. <span> </span>Case "Tajikistan" secondpart = "TJK"
  307. <span> </span>Case "United Republic of Tanzania" secondpart = "TZA"
  308. <span> </span>Case "Thailand" secondpart = "THA"
  309. <span> </span>Case "Timor-Leste, Democratic Republic of" secondpart = "TLS"
  310. <span> </span>Case "Togo" secondpart = "TGO"
  311. <span> </span>Case "Tokelau (Tokelau Islands)" secondpart = "TKL"
  312. <span> </span>Case "Tonga" secondpart = "TON"
  313. <span> </span>Case "Trinidad and Tobago" secondpart = "TTO"
  314. <span> </span>Case "Tunisia" secondpart = "TUN"
  315. <span> </span>Case "Turkey" secondpart = "TUR"
  316. <span> </span>Case "Turkmenistan" secondpart = "TKM"
  317. <span> </span>Case "Turks And Caicos Islands" secondpart = "TCA"
  318. <span> </span>Case "Tuvalu (was part of Gilbert &amp; Ellice Islands)" secondpart = "TUV"
  319. <span> </span>Case "US Virgin Islands" secondpart = "VIR"
  320. <span> </span>Case "Uganda" secondpart = "UGA"
  321. <span> </span>Case "Ukraine" secondpart = "UKR"
  322. <span> </span>Case "United Arab Emirates" secondpart = "ARE"
  323. <span> </span>Case "United Kingdom" secondpart = "GBR"
  324. <span> </span>Case "United States Minor Outlying Islands" secondpart = "UMI"
  325. <span> </span>Case "United States" secondpart = "USA"
  326. <span> </span>Case "Uruguay" secondpart = "URY"
  327. <span> </span>Case "Uzbekistan" secondpart = "UZB"
  328. <span> </span>Case "Vanuatu" secondpart = "VUT"
  329. <span> </span>Case "Venezuela" secondpart = "VEN"
  330. <span> </span>Case "Vietnam" secondpart = "VNM"
  331. <span> </span>Case "Wallis And Futuna Islands" secondpart = "WLF"
  332. <span> </span>Case "Western Sahara" secondpart = "ESH"
  333. <span> </span>Case "Yemen" secondpart = "YEM"
  334. <span> </span>Case "Yugoslavia" secondpart = "YUG"
  335. <span> </span>Case "Zambia" secondpart = "ZMB"
  336. <span> </span>Case "Zimbabwe" secondpart = "ZWE"
  337.  
  338. <span> </span>End Select
  339. <span> </span>Set tempstring = Nothing
  340. <span> </span>Set firstpart = Nothing
  341. <span> </span>Set secondpart = Nothing
  342. <span> </span>End If
  343. <span> </span>' The data doesn't have degrees symbols in it, so rip out the data, insert the symbols, then store it
  344. <span> </span>If str_UNITS = "&amp;unit=s" Then
  345. <span> </span>weathertemp = xmlstripper("&lt;tmp&gt;", weatherdata) &amp; Chr(176)' &amp; "F"
  346. <span> </span>Else
  347. <span> </span>weathertemp = xmlstripper("&lt;tmp&gt;", weatherdata) &amp; Chr(176)' &amp; "C"
  348. <span> </span>End If
  349. <span> </span>Object.PersistStorage("Fahrenheit") = weathertemp
  350. <span> </span>DesktopX.ScriptObject("Weather Temp").Object.Text = Object.PersistStorage("Fahrenheit")
  351. <span> </span>' Strip out all the other info
  352. <span> </span>conditions = xmlstripper("&lt;cc&gt;", weatherdata)
  353. <span> </span>conditions = xmlstripper("&lt;t&gt;", conditions)
  354. <span> </span>desktopx.Object("Weather Conditions").text = conditions
  355. <span> </span>
  356. <span> </span>conditions = xmlstripper("&lt;icon&gt;", weatherdata)
  357. <span> </span>Object.PersistStorage("Conditions") = conditions
  358. <span> </span>If IsNumeric(conditions) Then
  359. <span> </span>Object.State = conditions
  360. <span> </span>Else
  361. <span> </span>Object.State = "NA"
  362. <span> </span>End If
  363. <span> </span>End If
  364. <span> </span>
  365. <span> </span>' Clear variables for clean code
  366. <span> </span>Set http = nothing
  367. <span> </span>Set weatherdata = Nothing
  368. <span> </span>Set weathertemp = Nothing
  369. <span> </span>Set forecastdatastart = Nothing
  370. <span> </span>Set forecastdataend = Nothing
  371. <span> </span>End If
  372. End Sub
  373.  
  374.  
  375. Function xmlstripper(param, string)
  376. <span> </span>datastart = InStr(string, param) + Len(param)
  377. <span> </span>datalength = Instr(string, "&lt;/" &amp; Right(param, Len(param) - 1)) - datastart
  378. <span> </span>xmlstripper = Mid(string, datastart, datalength)
  379. End Function

 

Code on Temperature Object

Code: vbscript
  1. Function Object_OnLButtonUp(x,y,dragged)
  2. <span> </span>If dragged = False Then
  3. <span> </span>If DesktopX.ScriptObject("Weather Icon").tempunit = "m" Then
  4. <span> </span>DesktopX.ScriptObject("Weather Icon").tempunit = "s"
  5. <span> </span>Else
  6. <span> </span>DesktopX.ScriptObject("Weather Icon").tempunit = "m"
  7. <span> </span>End If
  8. <span> </span>DesktopX.ScriptObject("Weather Icon").Object_OnTimer6001
  9. <span> </span>End If
  10. End Function

 

Any help would be great.

3,130 views 2 replies
Reply #1 Top

pm or  mail to  _martin_ :)

Reply #2 Top

All my weather widgets have been doing the same thing for 2 days. I have to switch locations back and forth before it stabalizes to what the actual weather is.