Yincognito wrote: ↑June 3rd, 2020, 2:21 pm
Yes, it does (include unit information). It's on every unit related section in the JSON (i.e. observation, all kinds of forecast, etc). Look for the
units: string in the new JSON and you'll see what I mean.
Ah, that explains things. I assumed in the old json (which I don't have access too obviously) there was some section or key that stored all those individually, based on the following regex in the original [@UnitParent]:
Code: Select all
RegExp=(?siU){"units":(.*),"temp":(.*),.*"speed":(.*),.*"distance":(.*),.*accumulation":(.*),.*"precip":(.*),.*"pressure":(.*)}
I didn't realise I had to create my own measure to provide all the right units based on that single "unit:[x]" string, e.g. "units:m" means provide all metric unit types. I can fix that.
jsmorley wrote:So by all means carry on, but for myself, I'm not going to even look at how to parse any "different" JSON format until I'm happy that there is something reliable that I can count on. If we have to, or desire to, use a UserAgent string to force one format or another, I'm happy to cross that bridge when we get to it, but I'm not confident that we have proved that there is ANY way to get a single, consistent format yet, and I'm going to wait a little longer to see if weather.com settles down.
Fair enough, but this is the site source I'm being provided via webparser and without my new measures and regex, my weather skin won't work. Others may (and seem to) have the same issue.
SilverAzide wrote:This is the question we're all wondering about. No one knows why people with desktop browsers get the V3 JSON. It is random, and can go away with the cookie-clearing steps.
JSMorley's suggestion to wait is a good one, because this situation isn't settled yet. But if you need a solution now...
P.S.: On your tweaked JSON measures, great job! My only recommendation (besides restoring the units per Yincognito's suggestion), is to handle the short day names using a Time measure like the way
JSMorley's original file handles the month names (use the time stamp and return the short day using a format string per the user's locale). Your version only works for English.
Yeah, I need it now. Otherwise, how will I know whether the sun is going to come up tomorrow?
Seriously though, I've been using this for a few days and so far, it has worked continuously.
Good call on short day names, I was a bit short sighted there (and lazy, I guess).