Hello. I'm working on a skin which will display current weather conditions. I want the user to input the physical location (as in name of the city) in order to display info like temperature, humidity, weather description, etc.
So far I've managed to get the weather code based on the location input using Webparser:
Thanks for the replies. I did read the URL section of the Webparser measure, but for some reason casting the [mCodeOutput] measure as a section variable doesn't work for me. Neither did the whole parent-child solution, but I guess that's cause I'm simply too much of an idiot to understand it properly.
Fortunately, while I didn't manage to solve it in a proper way, I got it working via silly workaround. I noticed how I could use variables in links and decided to push the code into a variable first, then use it in the [mWeather] parser to get the info I wanted. I also learned I can skip the child measure to get the bits of data, so I moved that into the parent parser for location code (since I'm looking for just 1 piece of data).
[mWeatherParser]
Measure=WebParser
URL=https://weather.com/weather/today/l/[&mCodeOutput]
RegExp=... (all the stuff I want)
Also note here that the above [mWeatherParser] WebParser measure requires a DynamicVariables=1 option. It's very important, don't forget to add it, otherwise the measure won't work:
Instead of pause and unpause try disable and enable on the measure. And instead of OnChangeAction try FinishAction see if that works.
I think the paused tries to parse the thing regardless and there's nothing to parse so it will try again on the default update time. Instead, the disable won't allow it to parse at all until there's something fetched by the "parent".
kyriakos876 wrote: ↑January 14th, 2019, 7:55 pm
Instead of pause and unpause try disable and enable on the measure. And instead of OnChangeAction try FinishAction see if that works.
I think the paused tries to parse the thing regardless and there's nothing to parse so it will try again on the default update time. Instead, the disable won't allow it to parse at all until there's something fetched by the "parent".
I'm not sure if that's counter to what I said. I said that it might be possible for the "default update rate" to affect the "child". The child will indeed see the value of the parent no matter what and everything will be able to see the child's setting, but if the first time the parent tries to fetch information and has troubles, the child will retrieve nothing, and then it will wait for the next update (default update rate) eventhought the parent will have already fetched the information just a bit too little for the child.
I might be wrong as I'm not too familiar with WebParser, but that sounds like the logical thing to happen, to me at least.
kyriakos876 wrote: ↑January 15th, 2019, 6:53 pm
I'm not sure if that's counter to what I said. I said that it might be possible for the "default update rate" to affect the "child". The child will indeed see the value of the parent no matter what and everything will be able to see the child's setting, but if the first time the parent tries to fetch information and has troubles, the child will retrieve nothing, and then it will wait for the next update (default update rate) eventhought the parent will have already fetched the information just a bit too little for the child.
I might be wrong as I'm not too familiar with WebParser, but that sounds like the logical thing to happen, to me at least.
Yep, you're right, I just added that doesn't matter if child WebParser measures are enabled / unpaused or disabled / paused, they anyway will return the appropriate information, when the parent (based on its UpdateRate) parses the information.
Otherwise, yes, you're right.