Advertisement
slice14

new wu script

Aug 10th, 2016
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var url = 'http://api.wunderground.com/api/api_key/conditions/forecast10day/astronomy/lang:HU/q/'+(global('%LOCN'))+'.json';
  2.  
  3. var http = new XMLHttpRequest();
  4. http.open("GET", url, false);
  5. http.send();
  6.  
  7. if(http.status == 200) {
  8. Weather = JSON.parse(http.responseText);
  9. Srise = Weather.sun_phase.sunrise.hour; if (Srise != "") {
  10. Sunrise1 = Weather.sun_phase.sunrise.hour+'.'+Weather.sun_phase.sunrise.minute;
  11. Sunrise2 = Weather.sun_phase.sunrise.hour+':'+Weather.sun_phase.sunrise.minute;
  12. setGlobal('%Sunrise1',Sunrise1);
  13. setGlobal('%Sunrise2',Sunrise2); }
  14. Sset = Weather.sun_phase.sunset.hour; if (Sset != "") {
  15. Sunset1 = Weather.sun_phase.sunset.hour+'.'+Weather.sun_phase.sunset.minute;
  16. Sunset2 = Weather.sun_phase.sunset.hour+':'+Weather.sun_phase.sunset.minute;
  17. setGlobal('%Sunset1',Sunset1);
  18. setGlobal('%Sunset2',Sunset2); }
  19. Sunicon = 'file:///sdcard/Tasker/temp/icon/1.png';
  20. setGlobal('%Sunicon',Sunicon);
  21. Background = 'file:///sdcard/Tasker/temp/background/background.png';
  22. setGlobal('%Background',Background);
  23. var icontxtLookup = {
  24. 'http://icons.wxug.com/i/c/k/clear.gif': 'a',
  25. 'http://icons.wxug.com/i/c/k/sunny.gif': 'a',
  26. 'http://icons.wxug.com/i/c/k/nt_clear.gif': 'e',
  27. 'http://icons.wxug.com/i/c/k/nt_sunny.gif': 'e',
  28. 'http://icons.wxug.com/i/c/k/partlycloudy.gif': 'd',
  29. 'http://icons.wxug.com/i/c/k/partlysunny.gif': 'd',
  30. 'http://icons.wxug.com/i/c/k/mostlycloudy.gif': 'd',
  31. 'http://icons.wxug.com/i/c/k/mostlysunny.gif': 'd',
  32. 'http://icons.wxug.com/i/c/k/nt_partlycloudy.gif': 'f',
  33. 'http://icons.wxug.com/i/c/k/nt_partlysunny.gif': 'f',
  34. 'http://icons.wxug.com/i/c/k/nt_mostlycloudy.gif': 'f',
  35. 'http://icons.wxug.com/i/c/k/nt_mostlysunny.gif': 'f',
  36. 'http://icons.wxug.com/i/c/k/cloudy.gif': 'b',
  37. 'http://icons.wxug.com/i/c/k/nt_cloudy.gif': 'b',
  38. 'http://icons.wxug.com/i/c/k/fog.gif': 'c',
  39. 'http://icons.wxug.com/i/c/k/hazy.gif': 'c',
  40. 'http://icons.wxug.com/i/c/k/nt_fog.gif': 'c',
  41. 'http://icons.wxug.com/i/c/k/nt_hazy.gif': 'c',
  42. 'http://icons.wxug.com/i/c/k/chancesleet.gif': 'h',
  43. 'http://icons.wxug.com/i/c/k/sleet.gif': 'h',
  44. 'http://icons.wxug.com/i/c/k/nt_chancesleet.gif': 'h',
  45. 'http://icons.wxug.com/i/c/k/nt_sleet.gif': 'h',
  46. 'http://icons.wxug.com/i/c/k/chancerain.gif': 'g',
  47. 'http://icons.wxug.com/i/c/k/rain.gif': 'g',
  48. 'http://icons.wxug.com/i/c/k/nt_chancerain.gif': 'g',
  49. 'http://icons.wxug.com/i/c/k/nt_rain.gif': 'g',
  50. 'http://icons.wxug.com/i/c/k/chancetstorms.gif': 'j',
  51. 'http://icons.wxug.com/i/c/k/tstorms.gif': 'j',
  52. 'http://icons.wxug.com/i/c/k/nt_chancetstorms.gif': 'j',
  53. 'http://icons.wxug.com/i/c/k/nt_tstorms.gif': 'j',
  54. 'http://icons.wxug.com/i/c/k/chanceflurries.gif': 'i',
  55. 'http://icons.wxug.com/i/c/k/chancesnow.gif': 'i',
  56. 'http://icons.wxug.com/i/c/k/flurries.gif': 'i',
  57. 'http://icons.wxug.com/i/c/k/snow.gif': 'i',
  58. 'http://icons.wxug.com/i/c/k/nt_chanceflurries.gif': 'i',
  59. 'http://icons.wxug.com/i/c/k/nt_chancesnow.gif': 'i',
  60. 'http://icons.wxug.com/i/c/k/nt_flurries.gif': 'i',
  61. 'http://icons.wxug.com/i/c/k/nt_snow.gif': 'i',
  62. 'http://icons.wxug.com/i/c/k/unknown.gif': ' ',
  63. 'http://icons.wxug.com/i/c/k/nt_unknown.gif': ' ',
  64. '': ' ',
  65. };
  66. var iconLookup = {
  67. 'http://icons.wxug.com/i/c/k/clear.gif': 'file:///sdcard/Tasker/temp/icon/1.png',
  68. 'http://icons.wxug.com/i/c/k/sunny.gif': 'file:///sdcard/Tasker/temp/icon/1.png',
  69. 'http://icons.wxug.com/i/c/k/nt_clear.gif': 'file:///sdcard/Tasker/temp/icon/2.png',
  70. 'http://icons.wxug.com/i/c/k/nt_sunny.gif': 'file:///sdcard/Tasker/temp/icon/2.png',
  71. 'http://icons.wxug.com/i/c/k/partlycloudy.gif': 'file:///sdcard/Tasker/temp/icon/4.png',
  72. 'http://icons.wxug.com/i/c/k/partlysunny.gif': 'file:///sdcard/Tasker/temp/icon/4.png',
  73. 'http://icons.wxug.com/i/c/k/mostlycloudy.gif': 'file:///sdcard/Tasker/temp/icon/4.png',
  74. 'http://icons.wxug.com/i/c/k/mostlysunny.gif': 'file:///sdcard/Tasker/temp/icon/4.png',
  75. 'http://icons.wxug.com/i/c/k/nt_partlycloudy.gif': 'file:///sdcard/Tasker/temp/icon/5.png',
  76. 'http://icons.wxug.com/i/c/k/nt_partlysunny.gif': 'file:///sdcard/Tasker/temp/icon/5.png',
  77. 'http://icons.wxug.com/i/c/k/nt_mostlycloudy.gif': 'file:///sdcard/Tasker/temp/icon/5.png',
  78. 'http://icons.wxug.com/i/c/k/nt_mostlysunny.gif': 'file:///sdcard/Tasker/temp/icon/5.png',
  79. 'http://icons.wxug.com/i/c/k/cloudy.gif': 'file:///sdcard/Tasker/temp/icon/3.png',
  80. 'http://icons.wxug.com/i/c/k/nt_cloudy.gif': 'file:///sdcard/Tasker/temp/icon/3.png',
  81. 'http://icons.wxug.com/i/c/k/fog.gif': 'file:///sdcard/Tasker/temp/icon/6.png',
  82. 'http://icons.wxug.com/i/c/k/hazy.gif': 'file:///sdcard/Tasker/temp/icon/6.png',
  83. 'http://icons.wxug.com/i/c/k/nt_fog.gif': 'file:///sdcard/Tasker/temp/icon/6.png',
  84. 'http://icons.wxug.com/i/c/k/nt_hazy.gif': 'file:///sdcard/Tasker/temp/icon/6.png',
  85. 'http://icons.wxug.com/i/c/k/chancesleet.gif': 'file:///sdcard/Tasker/temp/icon/7.png',
  86. 'http://icons.wxug.com/i/c/k/sleet.gif': 'file:///sdcard/Tasker/temp/icon/7.png',
  87. 'http://icons.wxug.com/i/c/k/nt_chancesleet.gif': 'file:///sdcard/Tasker/temp/icon/7.png',
  88. 'http://icons.wxug.com/i/c/k/nt_sleet.gif': 'file:///sdcard/Tasker/temp/icon/7.png',
  89. 'http://icons.wxug.com/i/c/k/chancerain.gif': 'file:///sdcard/Tasker/temp/icon/8.png',
  90. 'http://icons.wxug.com/i/c/k/rain.gif': 'file:///sdcard/Tasker/temp/icon/8.png',
  91. 'http://icons.wxug.com/i/c/k/nt_chancerain.gif': 'file:///sdcard/Tasker/temp/icon/8.png',
  92. 'http://icons.wxug.com/i/c/k/nt_rain.gif': 'file:///sdcard/Tasker/temp/icon/8.png',
  93. 'http://icons.wxug.com/i/c/k/chancetstorms.gif': 'file:///sdcard/Tasker/temp/icon/9.png',
  94. 'http://icons.wxug.com/i/c/k/tstorms.gif': 'file:///sdcard/Tasker/temp/icon/9.png',
  95. 'http://icons.wxug.com/i/c/k/nt_chancetstorms.gif': 'file:///sdcard/Tasker/temp/icon/9.png',
  96. 'http://icons.wxug.com/i/c/k/nt_tstorms.gif': 'file:///sdcard/Tasker/temp/icon/9.png',
  97. 'http://icons.wxug.com/i/c/k/chanceflurries.gif': 'file:///sdcard/Tasker/temp/icon/10.png',
  98. 'http://icons.wxug.com/i/c/k/chancesnow.gif': 'file:///sdcard/Tasker/temp/icon/10.png',
  99. 'http://icons.wxug.com/i/c/k/flurries.gif': 'file:///sdcard/Tasker/temp/icon/10.png',
  100. 'http://icons.wxug.com/i/c/k/snow.gif': 'file:///sdcard/Tasker/temp/icon/10.png',
  101. 'http://icons.wxug.com/i/c/k/nt_chanceflurries.gif': 'file:///sdcard/Tasker/temp/icon/10.png',
  102. 'http://icons.wxug.com/i/c/k/nt_chancesnow.gif': 'file:///sdcard/Tasker/temp/icon/10.png',
  103. 'http://icons.wxug.com/i/c/k/nt_flurries.gif': 'file:///sdcard/Tasker/temp/icon/10.png',
  104. 'http://icons.wxug.com/i/c/k/nt_snow.gif': 'file:///sdcard/Tasker/temp/icon/10.png',
  105. 'http://icons.wxug.com/i/c/k/unknown.gif': 'file:///sdcard/Tasker/temp/icon/11.png',
  106. 'http://icons.wxug.com/i/c/k/nt_unknown.gif': 'file:///sdcard/Tasker/temp/icon/11.png',
  107. '': 'file:///sdcard/Tasker/temp/icon/11.png',
  108. };
  109. var windDirectionLookup = {
  110. 'északi': 'É',
  111. 'déli': 'D',
  112. 'keleti': 'K',
  113. 'nyugati': 'Ny',
  114. 'északkeleti': 'ÉK',
  115. 'északnyugati': 'ÉNy',
  116. 'délkeleti': 'DK',
  117. 'délnyugati': 'DNy',
  118. 'észak-északkeleti': 'ÉÉK',
  119. 'észak-északnyugati': 'ÉÉNy',
  120. 'dél-délkeleti': 'DDK',
  121. 'dél-délnyugati': 'DDNy',
  122. 'kelet-északkeleti': 'KÉK',
  123. 'kelet-délkeleti': 'KDK',
  124. 'nyugat-északnyugati': 'NyÉNy',
  125. 'nyugat-délnyugati': 'NyDNy',
  126. };
  127. Location1 = Weather.current_observation.display_location.city; if (Location1 == "") {
  128. setGlobal('%Location1'," "); } if (Location1 != "") { setGlobal('%Location1',Location1); }
  129. Location2 = Weather.current_observation.display_location.country; if (Location2 == "") {
  130. setGlobal('%Location2'," "); } if (Location2 != "") { setGlobal('%Location2',Location2); }
  131. Currentweather = Weather.current_observation.weather; if (Currentweather == "") {
  132. setGlobal('%Currentweather'," "); } if (Currentweather != "") {
  133. Currentweather2 = convert( Currentweather, 'htmlToText');
  134. setGlobal('%Currentweather',Currentweather2); }
  135. Currenttemp = Weather.current_observation.temp_c; if (Currenttemp == null) {
  136. setGlobal('%Currenttemp',"-"); } if (Currenttemp != null) {
  137. Currenttemp2 = Currenttemp.toFixed(0);
  138. setGlobal('%Currenttemp',Currenttemp2); }
  139. Currentwind = Weather.current_observation.wind_dir; if (Currentwind == "") {
  140. setGlobal('%Currentwind',"-"); } if (Currentwind != "") {
  141. setGlobal('%Currentwind',windDirectionLookup[Currentwind] || '-'); }
  142. Currentwindspeed = Weather.current_observation.wind_kph; if (Currentwindspeed == null) {
  143. setGlobal('%Currentwindspeed',"0 km/h"); } if (Currentwindspeed != null) {
  144. setGlobal('%Currentwindspeed',Currentwindspeed+' km/h'); }
  145. Currentwindgust = Weather.current_observation.wind_gust_kph; if (Currentwindgust == null) {
  146. setGlobal('%Currentwindgust',"0 km/h"); } if (Currentwindgust != null) {
  147. setGlobal('%Currentwindgust',Currentwindgust+' km/h'); }
  148. Currenticon = Weather.current_observation.icon_url;
  149. setGlobal('%Currenticontxt',icontxtLookup[Currenticon] || ' ');
  150. setGlobal('%Currenticon1',iconLookup[Currenticon] || 'file:///sdcard/Tasker/temp/icon/11.png');
  151. Currenthumidity = Weather.current_observation.relative_humidity; if (Currenthumidity == "") {
  152. setGlobal('%Currenthumidity',"-%"); } if (Currenthumidity != "") {
  153. setGlobal('%Currenthumidity',Currenthumidity); }
  154. setGlobal('%Forecast1ms',Weather.forecast.simpleforecast.forecastday[0].date.monthname_short);
  155. setGlobal('%Forecast1dy',Weather.forecast.simpleforecast.forecastday[0].date.day);
  156. setGlobal('%Forecast1d',Weather.forecast.simpleforecast.forecastday[0].date.weekday);
  157. setGlobal('%Forecast1ds',Weather.forecast.simpleforecast.forecastday[0].date.weekday_short);
  158. Forecast1w = Weather.forecast.simpleforecast.forecastday[0].conditions; if (Forecast1w == "") {
  159. setGlobal('%Forecast1w'," "); } if (Forecast1w != "") {
  160. Forecast1w2 = convert( Forecast1w, 'htmlToText');
  161. setGlobal('%Forecast1w',Forecast1w2); }
  162. Forecast1h = Weather.forecast.simpleforecast.forecastday[0].high.celsius; if (Forecast1h == null) {
  163. setGlobal('%Forecast1h',"-"); } if (Forecast1h != null) {
  164. setGlobal('%Forecast1h',Forecast1h); }
  165. Forecast1l = Weather.forecast.simpleforecast.forecastday[0].low.celsius; if (Forecast1l == null) {
  166. setGlobal('%Forecast1l',"-"); } if (Forecast1l != null) {
  167. setGlobal('%Forecast1l',Forecast1l); }
  168. Forecast1qd = Weather.forecast.simpleforecast.forecastday[0].qpf_day.mm; if (Forecast1qd == null) {
  169. setGlobal('%Forecast1qd',"0 mm"); } if (Forecast1qd != null) {
  170. setGlobal('%Forecast1qd',Forecast1qd+' mm'); }
  171. Forecast1qn = Weather.forecast.simpleforecast.forecastday[0].qpf_night.mm; if (Forecast1qn == null) {
  172. setGlobal('%Forecast1qn',"0 mm"); } if (Forecast1qn != null) {
  173. setGlobal('%Forecast1qn',Forecast1qn+' mm'); }
  174. Forecast1sd = Weather.forecast.simpleforecast.forecastday[0].snow_day.cm; if (Forecast1sd == null) {
  175. setGlobal('%Forecast1sd',"0 cm"); } if (Forecast1sd != null) {
  176. setGlobal('%Forecast1sd',Forecast1sd+' cm'); }
  177. Forecast1sn = Weather.forecast.simpleforecast.forecastday[0].snow_night.cm; if (Forecast1sn == null)
  178. { setGlobal('%Forecast1sn',"0 cm"); } if (Forecast1sn != null) {
  179. setGlobal('%Forecast1sn',Forecast1sn+' cm'); }
  180. Forecast1icon = Weather.forecast.simpleforecast.forecastday[0].icon_url;
  181. setGlobal('%Forecast1icontxt',icontxtLookup[Forecast1icon] || ' ');
  182. setGlobal('%Forecast1icon1',iconLookup[Forecast1icon] || 'file:///sdcard/Tasker/temp/icon/11.png');
  183. Forecast1hm = Weather.forecast.simpleforecast.forecastday[0].avehumidity; if (Forecast1hm == null) {
  184. setGlobal('%Forecast1hm',"0%"); } if (Forecast1hm != null) {
  185. setGlobal('%Forecast1hm',Forecast1hm+'%'); }
  186. Forecast1td = Weather.forecast.txt_forecast.forecastday[0].fcttext_metric;
  187. Forecast1td2 = Forecast1td; if (Forecast1td2.indexOf('legmagasabb') === -1) {
  188. setGlobal('%Forecast1td1'," ");
  189. }
  190. else { setGlobal('%Forecast1td1',Forecast1td2);
  191. }
  192. Forecast1td3 = Forecast1td.replace('°C', ' fok');
  193. Forecast1td32 = Forecast1td3; if (Forecast1td32.indexOf('legmagasabb') === -1) {
  194. setGlobal('%Forecast1td2'," ");
  195. }
  196. else { setGlobal('%Forecast1td2',Forecast1td32);
  197. }
  198. Forecast1tn = Weather.forecast.txt_forecast.forecastday[1].fcttext_metric; if (Forecast1tn == "") {
  199. setGlobal('%Forecast1tn1'," ");
  200. setGlobal('%Forecast1tn2'," "); } if (Forecast1tn != "") {
  201. Forecast1tn2 = Forecast1tn;
  202. Forecast1tn3 = Forecast1tn2.replace('°C', ' fok');
  203. setGlobal('%Forecast1tn1',Forecast1tn2);
  204. setGlobal('%Forecast1tn2',Forecast1tn3); }
  205. setGlobal('%Forecast2ms',Weather.forecast.simpleforecast.forecastday[1].date.monthname_short);
  206. setGlobal('%Forecast2dy',Weather.forecast.simpleforecast.forecastday[1].date.day);
  207. setGlobal('%Forecast2d',Weather.forecast.simpleforecast.forecastday[1].date.weekday);
  208. setGlobal('%Forecast2ds',Weather.forecast.simpleforecast.forecastday[1].date.weekday_short);
  209. Forecast2w = Weather.forecast.simpleforecast.forecastday[1].conditions; if (Forecast2w == "") {
  210. setGlobal('%Forecast2w'," "); } if (Forecast2w != "") {
  211. Forecast2w2 = convert( Forecast2w, 'htmlToText');
  212. setGlobal('%Forecast2w',Forecast2w2); }
  213. Forecast2h = Weather.forecast.simpleforecast.forecastday[1].high.celsius; if (Forecast2h == null) {
  214. setGlobal('%Forecast2h',"-"); } if (Forecast2h != null) {
  215. setGlobal('%Forecast2h',Forecast2h); }
  216. Forecast2l = Weather.forecast.simpleforecast.forecastday[1].low.celsius; if (Forecast2l == null) {
  217. setGlobal('%Forecast2l',"-"); } if (Forecast2l != null) {
  218. setGlobal('%Forecast2l',Forecast2l); }
  219. Forecast2qd = Weather.forecast.simpleforecast.forecastday[1].qpf_day.mm; if (Forecast2qd == null) {
  220. setGlobal('%Forecast2qd',"0 mm"); } if (Forecast2qd != null) {
  221. setGlobal('%Forecast2qd',Forecast2qd+' mm'); }
  222. Forecast2qn = Weather.forecast.simpleforecast.forecastday[1].qpf_night.mm; if (Forecast2qn == null) {
  223. setGlobal('%Forecast2qn',"0 mm"); } if (Forecast2qn != null) {
  224. setGlobal('%Forecast2qn',Forecast2qn+' mm'); }
  225. Forecast2sd = Weather.forecast.simpleforecast.forecastday[1].snow_day.cm; if (Forecast2sd == null) {
  226. setGlobal('%Forecast2sd',"0 cm"); } if (Forecast2sd != null) {
  227. setGlobal('%Forecast2sd',Forecast2sd+' cm'); }
  228. Forecast2sn = Weather.forecast.simpleforecast.forecastday[1].snow_night.cm; if (Forecast2sn == null)
  229. { setGlobal('%Forecast2sn',"0 cm"); } if (Forecast2sn != null) {
  230. setGlobal('%Forecast2sn',Forecast2sn+' cm'); }
  231. Forecast2icon = Weather.forecast.simpleforecast.forecastday[1].icon_url;
  232. setGlobal('%Forecast2icontxt',icontxtLookup[Forecast2icon] || ' ');
  233. setGlobal('%Forecast2icon1',iconLookup[Forecast2icon] || 'file:///sdcard/Tasker/temp/icon/11.png');
  234. Forecast2hm = Weather.forecast.simpleforecast.forecastday[1].avehumidity; if (Forecast2hm == null) {
  235. setGlobal('%Forecast2hm',"0%"); } if (Forecast2hm != null) {
  236. setGlobal('%Forecast2hm',Forecast2hm+'%'); }
  237. Forecast2td = Weather.forecast.txt_forecast.forecastday[2].fcttext_metric; if (Forecast2td == "") {
  238. setGlobal('%Forecast2td1'," ");
  239. setGlobal('%Forecast2td2'," "); } if (Forecast2td != "") {
  240. Forecast2td2 = Forecast2td;
  241. setGlobal('%Forecast2td1',Forecast2td2);
  242. Forecast2td3 = Forecast2td2.replace('°C', ' fok');
  243. setGlobal('%Forecast2td2',Forecast2td3); }
  244. Forecast2tn = Weather.forecast.txt_forecast.forecastday[3].fcttext_metric; if (Forecast2tn == "") {
  245. setGlobal('%Forecast2tn1'," ");
  246. setGlobal('%Forecast2tn2'," "); } if (Forecast2tn != "") {
  247. Forecast2tn2 = Forecast2tn;
  248. setGlobal('%Forecast2tn1',Forecast2tn2);
  249. Forecast2tn3 = Forecast2tn2.replace('°C', ' fok');
  250. setGlobal('%Forecast2tn2',Forecast2tn3); }
  251. setGlobal('%Forecast3ms',Weather.forecast.simpleforecast.forecastday[2].date.monthname_short);
  252. setGlobal('%Forecast3dy',Weather.forecast.simpleforecast.forecastday[2].date.day);
  253. setGlobal('%Forecast3d',Weather.forecast.simpleforecast.forecastday[2].date.weekday);
  254. setGlobal('%Forecast3ds',Weather.forecast.simpleforecast.forecastday[2].date.weekday_short);
  255. Forecast3w = Weather.forecast.simpleforecast.forecastday[2].conditions; if (Forecast3w == "") {
  256. setGlobal('%Forecast3w'," "); } if (Forecast3w != "") {
  257. Forecast3w2 = convert( Forecast3w, 'htmlToText');
  258. setGlobal('%Forecast3w',Forecast3w2); }
  259. Forecast3h = Weather.forecast.simpleforecast.forecastday[2].high.celsius; if (Forecast3h == null) {
  260. setGlobal('%Forecast3h',"-"); } if (Forecast3h != null) {
  261. setGlobal('%Forecast3h',Forecast3h); }
  262. Forecast3l = Weather.forecast.simpleforecast.forecastday[2].low.celsius; if (Forecast3l == null) {
  263. setGlobal('%Forecast3l',"-"); } if (Forecast3l != null) {
  264. setGlobal('%Forecast3l',Forecast3l); }
  265. Forecast3qd = Weather.forecast.simpleforecast.forecastday[2].qpf_day.mm; if (Forecast3qd == null) {
  266. setGlobal('%Forecast3qd',"0 mm"); } if (Forecast3qd != null) {
  267. setGlobal('%Forecast3qd',Forecast3qd+' mm'); }
  268. Forecast3qn = Weather.forecast.simpleforecast.forecastday[2].qpf_night.mm; if (Forecast3qn == null) {
  269. setGlobal('%Forecast3qn',"0 mm"); } if (Forecast3qn != null) {
  270. setGlobal('%Forecast3qn',Forecast3qn+' mm'); }
  271. Forecast3sd = Weather.forecast.simpleforecast.forecastday[2].snow_day.cm; if (Forecast3sd == null) {
  272. setGlobal('%Forecast3sd',"0 cm"); } if (Forecast3sd != null) {
  273. setGlobal('%Forecast3sd',Forecast3sd+' cm'); }
  274. Forecast3sn = Weather.forecast.simpleforecast.forecastday[2].snow_night.cm; if (Forecast3sn == null)
  275. { setGlobal('%Forecast3sn',"0 cm"); } if (Forecast3sn != null) {
  276. setGlobal('%Forecast3sn',Forecast3sn+' cm'); }
  277. Forecast3icon = Weather.forecast.simpleforecast.forecastday[2].icon_url;
  278. setGlobal('%Forecast3icontxt',icontxtLookup[Forecast3icon] || ' ');
  279. setGlobal('%Forecast3icon1',iconLookup[Forecast3icon] || 'file:///sdcard/Tasker/temp/icon/11.png');
  280. Forecast3hm = Weather.forecast.simpleforecast.forecastday[2].avehumidity; if (Forecast3hm == null) {
  281. setGlobal('%Forecast3hm',"0%"); } if (Forecast3hm != null) {
  282. setGlobal('%Forecast3hm',Forecast3hm+'%'); }
  283. Forecast3td = Weather.forecast.txt_forecast.forecastday[4].fcttext_metric; if (Forecast3td == "") {
  284. setGlobal('%Forecast3td1'," ");
  285. setGlobal('%Forecast3td2'," "); } if (Forecast3td != "") {
  286. Forecast3td2 = Forecast3td;
  287. setGlobal('%Forecast3td1',Forecast3td2);
  288. Forecast3td3 = Forecast3td2.replace('°C', ' fok');
  289. setGlobal('%Forecast3td2',Forecast3td3); }                             
  290. Forecast3tn = Weather.forecast.txt_forecast.forecastday[5].fcttext_metric; if (Forecast3tn == "") {
  291. setGlobal('%Forecast3tn1'," ");
  292. setGlobal('%Forecast3tn2'," "); } if (Forecast3tn != "") {
  293. Forecast3tn2 = Forecast3tn;
  294. setGlobal('%Forecast3tn1',Forecast3tn2);
  295. Forecast3tn3 = Forecast3tn2.replace('°C', ' fok');
  296. setGlobal('%Forecast3tn2',Forecast3tn3); }
  297. setGlobal('%Forecast4ms',Weather.forecast.simpleforecast.forecastday[3].date.monthname_short);
  298. setGlobal('%Forecast4dy',Weather.forecast.simpleforecast.forecastday[3].date.day);
  299. setGlobal('%Forecast4d',Weather.forecast.simpleforecast.forecastday[3].date.weekday);
  300. setGlobal('%Forecast4ds',Weather.forecast.simpleforecast.forecastday[3].date.weekday_short);
  301. Forecast4w = Weather.forecast.simpleforecast.forecastday[3].conditions; if (Forecast4w == "") {
  302. setGlobal('%Forecast4w'," "); } if (Forecast4w != "") {
  303. Forecast4w2 = convert( Forecast4w, 'htmlToText');
  304. setGlobal('%Forecast4w',Forecast4w2); }
  305. Forecast4h = Weather.forecast.simpleforecast.forecastday[3].high.celsius; if (Forecast4h == null) {
  306. setGlobal('%Forecast4h',"-"); } if (Forecast4h != null) {
  307. setGlobal('%Forecast4h',Forecast4h); }
  308. Forecast4l = Weather.forecast.simpleforecast.forecastday[3].low.celsius; if (Forecast4l == null) {
  309. setGlobal('%Forecast4l',"-"); } if (Forecast4l != null) {
  310. setGlobal('%Forecast4l',Forecast4l); }
  311. Forecast4qd = Weather.forecast.simpleforecast.forecastday[3].qpf_day.mm; if (Forecast4qd == null) {
  312. setGlobal('%Forecast4qd',"0 mm"); } if (Forecast4qd != null) {
  313. setGlobal('%Forecast4qd',Forecast4qd+' mm'); }
  314. Forecast4qn = Weather.forecast.simpleforecast.forecastday[3].qpf_night.mm; if (Forecast4qn == null) {
  315. setGlobal('%Forecast4qn',"0 mm"); } if (Forecast4qn != null) {
  316. setGlobal('%Forecast4qn',Forecast4qn+' mm'); }
  317. Forecast4sd = Weather.forecast.simpleforecast.forecastday[3].snow_day.cm; if (Forecast4sd == null) {
  318. setGlobal('%Forecast4sd',"0 cm"); } if (Forecast4sd != null) {
  319. setGlobal('%Forecast4sd',Forecast4sd+' cm'); }
  320. Forecast4sn = Weather.forecast.simpleforecast.forecastday[3].snow_night.cm; if (Forecast4sn == null)
  321. { setGlobal('%Forecast4sn',"0 cm"); } if (Forecast4sn != null) {
  322. setGlobal('%Forecast4sn',Forecast4sn+' cm'); }
  323. Forecast4icon = Weather.forecast.simpleforecast.forecastday[3].icon_url;
  324. setGlobal('%Forecast4icontxt',icontxtLookup[Forecast4icon] || ' ');
  325. setGlobal('%Forecast4icon1',iconLookup[Forecast4icon] || 'file:///sdcard/Tasker/temp/icon/11.png');
  326. Forecast4hm = Weather.forecast.simpleforecast.forecastday[3].avehumidity; if (Forecast4hm == null) {
  327. setGlobal('%Forecast4hm',"0%"); } if (Forecast4hm != null) {
  328. setGlobal('%Forecast4hm',Forecast4hm+'%'); }
  329. Forecast4td = Weather.forecast.txt_forecast.forecastday[6].fcttext_metric; if (Forecast4td == "") {
  330. setGlobal('%Forecast4td1'," ");
  331. setGlobal('%Forecast4td2'," "); } if (Forecast4td != "") {
  332. Forecast4td2 = Forecast4td;
  333. setGlobal('%Forecast4td1',Forecast4td2);
  334. Forecast4td3 = Forecast4td2.replace('°C', ' fok');
  335. setGlobal('%Forecast4td2',Forecast4td3); }                             
  336. Forecast4tn = Weather.forecast.txt_forecast.forecastday[7].fcttext_metric; if (Forecast4tn == "") {
  337. setGlobal('%Forecast4tn1'," ");
  338. setGlobal('%Forecast4tn2'," "); } if (Forecast4tn != "") {
  339. Forecast4tn2 = Forecast4tn;
  340. setGlobal('%Forecast4tn1',Forecast4tn2);
  341. Forecast4tn3 = Forecast4tn2.replace('°C', ' fok');
  342. setGlobal('%Forecast4tn2',Forecast4tn3); }
  343. setGlobal('%Forecast5ms',Weather.forecast.simpleforecast.forecastday[4].date.monthname_short);
  344. setGlobal('%Forecast5dy',Weather.forecast.simpleforecast.forecastday[4].date.day);
  345. setGlobal('%Forecast5d',Weather.forecast.simpleforecast.forecastday[4].date.weekday);
  346. setGlobal('%Forecast5ds',Weather.forecast.simpleforecast.forecastday[4].date.weekday_short);
  347. Forecast5w = Weather.forecast.simpleforecast.forecastday[4].conditions; if (Forecast5w == "") {
  348. setGlobal('%Forecast5w'," "); } if (Forecast5w != "") {
  349. Forecast5w2 = convert( Forecast5w, 'htmlToText');
  350. setGlobal('%Forecast5w',Forecast5w2); }
  351. Forecast5h = Weather.forecast.simpleforecast.forecastday[4].high.celsius; if (Forecast5h == null) {
  352. setGlobal('%Forecast5h',"-"); } if (Forecast5h != null) {
  353. setGlobal('%Forecast5h',Forecast5h); }
  354. Forecast5l = Weather.forecast.simpleforecast.forecastday[4].low.celsius; if (Forecast5l == null) {
  355. setGlobal('%Forecast5l',"-"); } if (Forecast5l != null) {
  356. setGlobal('%Forecast5l',Forecast5l); }
  357. Forecast5qd = Weather.forecast.simpleforecast.forecastday[4].qpf_day.mm; if (Forecast5qd == null) {
  358. setGlobal('%Forecast5qd',"0 mm"); } if (Forecast5qd != null) {
  359. setGlobal('%Forecast5qd',Forecast5qd+' mm'); }
  360. Forecast5qn = Weather.forecast.simpleforecast.forecastday[4].qpf_night.mm; if (Forecast5qn == null) {
  361. setGlobal('%Forecast5qn',"0 mm"); } if (Forecast5qn != null) {
  362. setGlobal('%Forecast5qn',Forecast5qn+' mm'); }
  363. Forecast5sd = Weather.forecast.simpleforecast.forecastday[4].snow_day.cm; if (Forecast5sd == null) {
  364. setGlobal('%Forecast5sd',"0 cm"); } if (Forecast5sd != null) {
  365. setGlobal('%Forecast5sd',Forecast5sd+' cm'); }
  366. Forecast5sn = Weather.forecast.simpleforecast.forecastday[4].snow_night.cm; if (Forecast5sn == null)
  367. { setGlobal('%Forecast5sn',"0 cm"); } if (Forecast5sn != null) {
  368. setGlobal('%Forecast5sn',Forecast5sn+' cm'); }
  369. Forecast5icon = Weather.forecast.simpleforecast.forecastday[4].icon_url;
  370. setGlobal('%Forecast5icontxt',icontxtLookup[Forecast5icon] || ' ');
  371. setGlobal('%Forecast5icon1',iconLookup[Forecast5icon] || 'file:///sdcard/Tasker/temp/icon/11.png');
  372. Forecast5hm = Weather.forecast.simpleforecast.forecastday[4].avehumidity; if (Forecast5hm == null) {
  373. setGlobal('%Forecast5hm',"0%"); } if (Forecast5hm != null) {
  374. setGlobal('%Forecast5hm',Forecast5hm+'%'); }
  375. Forecast5td = Weather.forecast.txt_forecast.forecastday[8].fcttext_metric; if (Forecast5td == "") {
  376. setGlobal('%Forecast5td1'," ");
  377. setGlobal('%Forecast5td2'," "); } if (Forecast5td != "") {
  378. Forecast5td2 = Forecast5td;
  379. setGlobal('%Forecast5td1',Forecast5td2);
  380. Forecast5td3 = Forecast5td2.replace('°C', ' fok');
  381. setGlobal('%Forecast5td2',Forecast5td3); }                             
  382. Forecast5tn = Weather.forecast.txt_forecast.forecastday[9].fcttext_metric; if (Forecast5tn == "") {
  383. setGlobal('%Forecast5tn1'," ");
  384. setGlobal('%Forecast5tn2'," "); } if (Forecast5tn != "") {
  385. Forecast5tn2 = Forecast5tn;
  386. setGlobal('%Forecast5tn1',Forecast5tn2);
  387. Forecast5tn3 = Forecast5tn2.replace('°C' , ' fok');
  388. setGlobal('%Forecast5tn2',Forecast5tn3); }
  389. setGlobal('%Forecast6ms',Weather.forecast.simpleforecast.forecastday[5].date.monthname_short);
  390. setGlobal('%Forecast6dy',Weather.forecast.simpleforecast.forecastday[5].date.day);
  391. setGlobal('%Forecast6d',Weather.forecast.simpleforecast.forecastday[5].date.weekday);
  392. setGlobal('%Forecast6ds',Weather.forecast.simpleforecast.forecastday[5].date.weekday_short);
  393. Forecast6w = Weather.forecast.simpleforecast.forecastday[5].conditions; if (Forecast6w == "") {
  394. setGlobal('%Forecast6w'," "); } if (Forecast6w != "") {
  395. Forecast6w2 = convert( Forecast6w, 'htmlToText');
  396. setGlobal('%Forecast6w',Forecast6w2); }
  397. Forecast6h = Weather.forecast.simpleforecast.forecastday[5].high.celsius; if (Forecast6h == null) {
  398. setGlobal('%Forecast6h',"-"); } if (Forecast6h != null) {
  399. setGlobal('%Forecast6h',Forecast6h); }
  400. Forecast6l = Weather.forecast.simpleforecast.forecastday[5].low.celsius; if (Forecast6l == null) {
  401. setGlobal('%Forecast6l',"-"); } if (Forecast6l != null) {
  402. setGlobal('%Forecast6l',Forecast6l); }
  403. Forecast6qd = Weather.forecast.simpleforecast.forecastday[5].qpf_day.mm; if (Forecast6qd == null) {
  404. setGlobal('%Forecast6qd',"0 mm"); } if (Forecast6qd != null) {
  405. setGlobal('%Forecast6qd',Forecast6qd+' mm'); }
  406. Forecast6qn = Weather.forecast.simpleforecast.forecastday[5].qpf_night.mm; if (Forecast6qn == null) {
  407. setGlobal('%Forecast6qn',"0 mm"); } if (Forecast6qn != null) {
  408. setGlobal('%Forecast6qn',Forecast6qn+' mm'); }
  409. Forecast6sd = Weather.forecast.simpleforecast.forecastday[5].snow_day.cm; if (Forecast6sd == null) {
  410. setGlobal('%Forecast6sd',"0 cm"); } if (Forecast6sd != null) {
  411. setGlobal('%Forecast6sd',Forecast6sd+' cm'); }
  412. Forecast6sn = Weather.forecast.simpleforecast.forecastday[5].snow_night.cm; if (Forecast6sn == null)
  413. { setGlobal('%Forecast6sn',"0 cm"); } if (Forecast6sn != null) {
  414. setGlobal('%Forecast6sn',Forecast6sn+' cm'); }
  415. Forecast6icon = Weather.forecast.simpleforecast.forecastday[5].icon_url;
  416. setGlobal('%Forecast6icontxt',icontxtLookup[Forecast6icon] || ' ');
  417. setGlobal('%Forecast6icon1',iconLookup[Forecast6icon] || 'file:///sdcard/Tasker/temp/icon/11.png');
  418. Forecast6hm = Weather.forecast.simpleforecast.forecastday[5].avehumidity; if (Forecast6hm == null) {
  419. setGlobal('%Forecast6hm',"0%"); } if (Forecast6hm != null) {
  420. setGlobal('%Forecast6hm',Forecast6hm+'%'); }
  421. Forecast6td = Weather.forecast.txt_forecast.forecastday[10].fcttext_metric; if (Forecast6td == "") {
  422. setGlobal('%Forecast6td1'," ");
  423. setGlobal('%Forecast6td2'," "); } if (Forecast6td != "") {
  424. Forecast6td2 = Forecast6td;
  425. setGlobal('%Forecast6td1',Forecast6td2);
  426. Forecast6td3 = Forecast6td2.replace('°C', ' fok');
  427. setGlobal('%Forecast6td2',Forecast6td3); }                                 
  428. Forecast6tn = Weather.forecast.txt_forecast.forecastday[11].fcttext_metric; if (Forecast6tn == "") {
  429. setGlobal('%Forecast6tn1'," ");
  430. setGlobal('%Forecast6tn2'," "); } if (Forecast6tn != "") {
  431. Forecast6tn2 = Forecast6tn;
  432. setGlobal('%Forecast6tn1',Forecast6tn2);
  433. Forecast6tn3 = Forecast6tn2.replace('°C', ' fok');
  434. setGlobal('%Forecast6tn2',Forecast6tn3); }
  435. setGlobal('%Forecast7ms',Weather.forecast.simpleforecast.forecastday[6].date.monthname_short);
  436. setGlobal('%Forecast7dy',Weather.forecast.simpleforecast.forecastday[6].date.day);
  437. setGlobal('%Forecast7d',Weather.forecast.simpleforecast.forecastday[6].date.weekday);
  438. setGlobal('%Forecast7ds',Weather.forecast.simpleforecast.forecastday[6].date.weekday_short);
  439. Forecast7w = Weather.forecast.simpleforecast.forecastday[6].conditions; if (Forecast7w == "") {
  440. setGlobal('%Forecast7w'," "); } if (Forecast7w != "") {
  441. Forecast7w2 = convert( Forecast7w, 'htmlToText');
  442. setGlobal('%Forecast7w',Forecast7w2); }
  443. Forecast7h = Weather.forecast.simpleforecast.forecastday[6].high.celsius; if (Forecast7h == null) {
  444. setGlobal('%Forecast7h',"-"); } if (Forecast7h != null) {
  445. setGlobal('%Forecast7h',Forecast7h); }
  446. Forecast7l = Weather.forecast.simpleforecast.forecastday[6].low.celsius; if (Forecast7l == null) {
  447. setGlobal('%Forecast7l',"-"); } if (Forecast7l != null) {
  448. setGlobal('%Forecast7l',Forecast7l); }
  449. Forecast7qd = Weather.forecast.simpleforecast.forecastday[6].qpf_day.mm; if (Forecast7qd == null) {
  450. setGlobal('%Forecast7qd',"0 mm"); } if (Forecast7qd != null) {
  451. setGlobal('%Forecast7qd',Forecast7qd+' mm'); }
  452. Forecast7qn = Weather.forecast.simpleforecast.forecastday[6].qpf_night.mm; if (Forecast7qn == null) {
  453. setGlobal('%Forecast7qn',"0 mm"); } if (Forecast7qn != null) {
  454. setGlobal('%Forecast7qn',Forecast7qn+' mm'); }
  455. Forecast7sd = Weather.forecast.simpleforecast.forecastday[6].snow_day.cm; if (Forecast7sd == null) {
  456. setGlobal('%Forecast7sd',"0 cm"); } if (Forecast7sd != null) {
  457. setGlobal('%Forecast7sd',Forecast7sd+' cm'); }
  458. Forecast7sn = Weather.forecast.simpleforecast.forecastday[6].snow_night.cm; if (Forecast7sn == null)
  459. { setGlobal('%Forecast7sn',"0 cm"); } if (Forecast7sn != null) {
  460. setGlobal('%Forecast7sn',Forecast7sn+' cm'); }
  461. Forecast7icon = Weather.forecast.simpleforecast.forecastday[6].icon_url;
  462. setGlobal('%Forecast7icontxt',icontxtLookup[Forecast7icon] || ' ');
  463. setGlobal('%Forecast7icon1',iconLookup[Forecast7icon] || 'file:///sdcard/Tasker/temp/icon/11.png');
  464. Forecast7hm = Weather.forecast.simpleforecast.forecastday[6].avehumidity; if (Forecast7hm == null) {
  465. setGlobal('%Forecast7hm',"0%"); } if (Forecast7hm != null) {
  466. setGlobal('%Forecast7hm',Forecast7hm+'%'); }
  467. Forecast7td = Weather.forecast.txt_forecast.forecastday[12].fcttext_metric; if (Forecast7td == "") {
  468. setGlobal('%Forecast7td1'," ");
  469. setGlobal('%Forecast7td2'," "); } if (Forecast7td != "") {
  470. Forecast7td2 = Forecast7td;
  471. setGlobal('%Forecast7td1',Forecast7td2);
  472. Forecast7td3 = Forecast7td2.replace('°C', ' fok');
  473. setGlobal('%Forecast7td2',Forecast7td3); }                             
  474. Forecast7tn = Weather.forecast.txt_forecast.forecastday[13].fcttext_metric; if (Forecast7tn == "") {
  475. setGlobal('%Forecast7tn1'," ");
  476. setGlobal('%Forecast7tn2'," "); } if (Forecast7tn != "") {
  477. Forecast7tn2 = Forecast7tn;
  478. setGlobal('%Forecast7tn1',Forecast7tn2);
  479. Forecast7tn3 = Forecast7tn2.replace('°C', ' fok');
  480. setGlobal('%Forecast7tn2',Forecast7tn3); }
  481. setGlobal('%Forecast8ms',Weather.forecast.simpleforecast.forecastday[7].date.monthname_short);
  482. setGlobal('%Forecast8dy',Weather.forecast.simpleforecast.forecastday[7].date.day);
  483. setGlobal('%Forecast8d',Weather.forecast.simpleforecast.forecastday[7].date.weekday);
  484. setGlobal('%Forecast8ds',Weather.forecast.simpleforecast.forecastday[7].date.weekday_short);
  485. Forecast8w = Weather.forecast.simpleforecast.forecastday[7].conditions; if (Forecast8w == "") {
  486. setGlobal('%Forecast8w'," "); } if (Forecast8w != "") {
  487. Forecast8w2 = convert( Forecast8w, 'htmlToText');
  488. setGlobal('%Forecast8w',Forecast8w2); }
  489. Forecast8h = Weather.forecast.simpleforecast.forecastday[7].high.celsius; if (Forecast8h == null) {
  490. setGlobal('%Forecast8h',"-"); } if (Forecast8h != null) {
  491. setGlobal('%Forecast8h',Forecast8h); }
  492. Forecast8l = Weather.forecast.simpleforecast.forecastday[7].low.celsius; if (Forecast8l == null) {
  493. setGlobal('%Forecast8l',"-"); } if (Forecast8l != null) {
  494. setGlobal('%Forecast8l',Forecast8l); }
  495. Forecast8qd = Weather.forecast.simpleforecast.forecastday[7].qpf_day.mm; if (Forecast8qd == null) {
  496. setGlobal('%Forecast8qd',"0 mm"); } if (Forecast8qd != null) {
  497. setGlobal('%Forecast8qd',Forecast8qd+' mm'); }
  498. Forecast8qn = Weather.forecast.simpleforecast.forecastday[7].qpf_night.mm; if (Forecast8qn == null) {
  499. setGlobal('%Forecast8qn',"0 mm"); } if (Forecast8qn != null) {
  500. setGlobal('%Forecast8qn',Forecast8qn+' mm'); }
  501. Forecast8sd = Weather.forecast.simpleforecast.forecastday[7].snow_day.cm; if (Forecast8sd == null) {
  502. setGlobal('%Forecast8sd',"0 cm"); } if (Forecast8sd != null) {
  503. setGlobal('%Forecast8sd',Forecast8sd+' cm'); }
  504. Forecast8sn = Weather.forecast.simpleforecast.forecastday[7].snow_night.cm; if (Forecast8sn == null)
  505. { setGlobal('%Forecast8sn',"0 cm"); } if (Forecast8sn != null) {
  506. setGlobal('%Forecast8sn',Forecast8sn+' cm'); }
  507. Forecast8icon = Weather.forecast.simpleforecast.forecastday[7].icon_url;
  508. setGlobal('%Forecast8icontxt',icontxtLookup[Forecast8icon] || ' ');
  509. setGlobal('%Forecast8icon1',iconLookup[Forecast8icon] || 'file:///sdcard/Tasker/temp/icon/11.png');
  510. Forecast8hm = Weather.forecast.simpleforecast.forecastday[7].avehumidity; if (Forecast8hm == null) {
  511. setGlobal('%Forecast8hm',"0%"); } if (Forecast8hm != null) {
  512. setGlobal('%Forecast8hm',Forecast8hm+'%'); }
  513. Forecast8td = Weather.forecast.txt_forecast.forecastday[14].fcttext_metric; if (Forecast8td == "") {
  514. setGlobal('%Forecast8td1'," ");
  515. setGlobal('%Forecast8td2'," "); } if (Forecast8td != "") {
  516. Forecast8td2 = Forecast8td;
  517. setGlobal('%Forecast8td1',Forecast8td2);
  518. Forecast8td3 = Forecast8td2.replace('°C', ' fok');
  519. setGlobal('%Forecast8td2',Forecast8td3); }                             
  520. Forecast8tn = Weather.forecast.txt_forecast.forecastday[15].fcttext_metric; if (Forecast8tn == "") {
  521. setGlobal('%Forecast8tn1'," ");
  522. setGlobal('%Forecast8tn2'," "); } if (Forecast8tn != "") {
  523. Forecast8tn2 = Forecast8tn;
  524. setGlobal('%Forecast8tn1',Forecast8tn2);
  525. Forecast8tn3 = Forecast8tn2.replace('°C', ' fok');
  526. setGlobal('%Forecast8tn2',Forecast8tn3); }
  527. setGlobal('%Forecast9ms',Weather.forecast.simpleforecast.forecastday[8].date.monthname_short);
  528. setGlobal('%Forecast9dy',Weather.forecast.simpleforecast.forecastday[8].date.day);
  529. setGlobal('%Forecast9d',Weather.forecast.simpleforecast.forecastday[8].date.weekday);
  530. setGlobal('%Forecast9ds',Weather.forecast.simpleforecast.forecastday[8].date.weekday_short);
  531. Forecast9w = Weather.forecast.simpleforecast.forecastday[8].conditions; if (Forecast9w == "") {
  532. setGlobal('%Forecast9w'," "); } if (Forecast9w != "") {
  533. Forecast9w2 = convert( Forecast9w, 'htmlToText');
  534. setGlobal('%Forecast9w',Forecast9w2); }
  535. Forecast9h = Weather.forecast.simpleforecast.forecastday[8].high.celsius; if (Forecast9h == null) {
  536. setGlobal('%Forecast9h',"-"); } if (Forecast9h != null) {
  537. setGlobal('%Forecast9h',Forecast9h); }
  538. Forecast9l = Weather.forecast.simpleforecast.forecastday[8].low.celsius; if (Forecast9l == null) {
  539. setGlobal('%Forecast9l',"-"); } if (Forecast9l != null) {
  540. setGlobal('%Forecast9l',Forecast9l); }
  541. Forecast9qd = Weather.forecast.simpleforecast.forecastday[8].qpf_day.mm; if (Forecast9qd == null) {
  542. setGlobal('%Forecast9qd',"0 mm"); } if (Forecast9qd != null) {
  543. setGlobal('%Forecast9qd',Forecast9qd+' mm'); }
  544. Forecast9qn = Weather.forecast.simpleforecast.forecastday[8].qpf_night.mm; if (Forecast9qn == null) {
  545. setGlobal('%Forecast9qn',"0 mm"); } if (Forecast9qn != null) {
  546. setGlobal('%Forecast9qn',Forecast9qn+' mm'); }
  547. Forecast9sd = Weather.forecast.simpleforecast.forecastday[8].snow_day.cm; if (Forecast9sd == null) {
  548. setGlobal('%Forecast9sd',"0 cm"); } if (Forecast9sd != null) {
  549. setGlobal('%Forecast9sd',Forecast9sd+' cm'); }
  550. Forecast9sn = Weather.forecast.simpleforecast.forecastday[8].snow_night.cm; if (Forecast9sn == null)
  551. { setGlobal('%Forecast9sn',"0 cm"); } if (Forecast9sn != null) {
  552. setGlobal('%Forecast9sn',Forecast9sn+' cm'); }
  553. Forecast9icon = Weather.forecast.simpleforecast.forecastday[8].icon_url;
  554. setGlobal('%Forecast9icontxt',icontxtLookup[Forecast9icon] || ' ');
  555. setGlobal('%Forecast9icon1',iconLookup[Forecast9icon] || 'file:///sdcard/Tasker/temp/icon/11.png');
  556. Forecast9hm = Weather.forecast.simpleforecast.forecastday[8].avehumidity; if (Forecast9hm == null) {
  557. setGlobal('%Forecast9hm',"0%"); } if (Forecast9hm != null) {
  558. setGlobal('%Forecast9hm',Forecast9hm+'%'); }
  559. Forecast9td = Weather.forecast.txt_forecast.forecastday[16].fcttext_metric; if (Forecast9td == "") {
  560. setGlobal('%Forecast9td1'," ");
  561. setGlobal('%Forecast9td2'," "); } if (Forecast9td != "") {
  562. Forecast9td2 = Forecast9td;
  563. setGlobal('%Forecast9td1',Forecast9td2);
  564. Forecast9td3 = Forecast9td2.replace('°C', ' fok');
  565. setGlobal('%Forecast9td2',Forecast9td3); }                             
  566. Forecast9tn = Weather.forecast.txt_forecast.forecastday[17].fcttext_metric; if (Forecast9tn == "") {
  567. setGlobal('%Forecast9tn1'," ");
  568. setGlobal('%Forecast9tn2'," "); } if (Forecast9tn != "") {
  569. Forecast9tn2 = Forecast9tn;
  570. setGlobal('%Forecast9tn1',Forecast9tn2);
  571. Forecast9tn3 = Forecast9tn2.replace('°C', ' fok');
  572. setGlobal('%Forecast9tn2',Forecast9tn3); }
  573. setGlobal('%Forecast10ms',Weather.forecast.simpleforecast.forecastday[9].date.monthname_short);
  574. setGlobal('%Forecast10dy',Weather.forecast.simpleforecast.forecastday[9].date.day);
  575. setGlobal('%Forecast10d',Weather.forecast.simpleforecast.forecastday[9].date.weekday);
  576. setGlobal('%Forecast10ds',Weather.forecast.simpleforecast.forecastday[9].date.weekday_short);
  577. Forecast10w = Weather.forecast.simpleforecast.forecastday[9].conditions; if (Forecast10w == "") {
  578. setGlobal('%Forecast10w'," "); } if (Forecast10w != "") {
  579. Forecast10w2 = convert( Forecast10w, 'htmlToText');
  580. setGlobal('%Forecast10w',Forecast10w2); }
  581. Forecast10h = Weather.forecast.simpleforecast.forecastday[9].high.celsius; if (Forecast10h == null) {
  582. setGlobal('%Forecast10h',"-"); } if (Forecast10h != null) {
  583. setGlobal('%Forecast10h',Forecast10h); }
  584. Forecast10l = Weather.forecast.simpleforecast.forecastday[9].low.celsius; if (Forecast10l == null) {
  585. setGlobal('%Forecast10l',"-"); } if (Forecast10l != null) {
  586. setGlobal('%Forecast10l',Forecast10l); }
  587. Forecast10qd = Weather.forecast.simpleforecast.forecastday[9].qpf_day.mm; if (Forecast10qd == null) {
  588. setGlobal('%Forecast10qd',"0 mm"); } if (Forecast10qd != null) {
  589. setGlobal('%Forecast10qd',Forecast10qd+' mm'); }
  590. Forecast10qn = Weather.forecast.simpleforecast.forecastday[9].qpf_night.mm; if (Forecast10qn == null) {
  591. setGlobal('%Forecast10qn',"0 mm"); } if (Forecast10qn != null) {
  592. setGlobal('%Forecast10qn',Forecast10qn+' mm'); }
  593. Forecast10sd = Weather.forecast.simpleforecast.forecastday[9].snow_day.cm; if (Forecast10sd == null) {
  594. setGlobal('%Forecast10sd',"0 cm"); } if (Forecast10sd != null) {
  595. setGlobal('%Forecast10sd',Forecast10sd+' cm'); }
  596. Forecast10sn = Weather.forecast.simpleforecast.forecastday[9].snow_night.cm; if (Forecast10sn == null)
  597. { setGlobal('%Forecast10sn',"0 cm"); } if (Forecast10sn != null) {
  598. setGlobal('%Forecast10sn',Forecast10sn+' cm'); }
  599. Forecast10icon = Weather.forecast.simpleforecast.forecastday[9].icon_url;
  600. setGlobal('%Forecast10icontxt',icontxtLookup[Forecast10icon] || ' ');
  601. setGlobal('%Forecast10icon1',iconLookup[Forecast10icon] || 'file:///sdcard/Tasker/temp/icon/11.png');
  602. Forecast10hm = Weather.forecast.simpleforecast.forecastday[9].avehumidity; if (Forecast10hm == null) {
  603. setGlobal('%Forecast10hm',"0%"); } if (Forecast10hm != null) {
  604. setGlobal('%Forecast10hm',Forecast10hm+'%'); }
  605. Forecast10td = Weather.forecast.txt_forecast.forecastday[18].fcttext_metric; if (Forecast10td == "") {
  606. setGlobal('%Forecast10td1'," ");
  607. setGlobal('%Forecast10td2'," "); } if (Forecast10td != "") {
  608. Forecast10td2 = Forecast10td;
  609. setGlobal('%Forecast10td1',Forecast10td2);
  610. Forecast10td3 = Forecast10td2.replace('°C', ' fok');
  611. setGlobal('%Forecast10td2',Forecast10td3); }                           
  612. Forecast10tn = Weather.forecast.txt_forecast.forecastday[19].fcttext_metric; if (Forecast10tn == "") {
  613. setGlobal('%Forecast10tn1'," ");
  614. setGlobal('%Forecast10tn2'," "); } if (Forecast10tn != "") {
  615. Forecast10tn2 = Forecast10tn;
  616. setGlobal('%Forecast10tn1',Forecast10tn2);
  617. Forecast10tn3 = Forecast10tn2.replace('°C', ' fok');
  618. setGlobal('%Forecast10tn2',Forecast10tn3); }
  619. var Update = global('%TIME');
  620. Update2 = Update.replace('.', ':');
  621. setGlobal('%Update',Update2);
  622. flashLong('A script sikeresen lefutott!');
  623.  }
  624. else{
  625.  flashLong('Nem sikerült letölteni az adatokat...');
  626.  }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement