$twcweather issues


#1

Is anyone having issues with these two variables in $twcweather?

arrayitem(0,$twcweather.forecast.temperatureMax)
lower(arrayItem(0,$twcweather.forecast.daypart[0].wxPhraseLong))

First one gives me today’s high and next one gives me forecasted conditions. Not all the time, but frequently, I am getting 0 for the high and “null” for the conditions. Some times it works, sometimes, it doesn’t. While I appreciate all the hard work that went into getting $twcweather (no small task, I’m sure), just wondering if anyone else is having issues retrieving these or other values? I’ve worked around it for now by checking to see if I get 0 for the high or null for that value and will just exit out, but wondering if others having issues.

Thanks!


#2

From my preliminary tests:

From approx 3AM - 3PM:

  • [0] is that day
  • [1] is that night
  • [2] is tomorrow day
  • [3] is tomorrow night

From approx 3PM - Midnight:

  • [0] is null
  • [1] is that night
  • [2] is tomorrow day
  • [3] is tomorrow night

From Midnight - approx 3AM:

  • [0] is null
  • [1] is the night in progress
  • [2] is the day that begins in about 5 hours
  • [3] is the night that begins in about 17 hours

This means that 12 hours each day, [0] will be null…
We can thank TheWeatherChannel for that confusing setup.