tfabris / CrowCam

A set of Bash scripts to control and maintain a YouTube live cam from a Synology NAS.
GNU General Public License v3.0
3 stars 3 forks source link

GetSunriseSunsetTimeFromGoogle won't work with certain locales #84

Closed tfabris closed 5 months ago

tfabris commented 5 months ago

It was pointed out by Mark Lord on the EmpegBBS that Google prints the "am" and "pm" parts of their sunrise/sunset times differently, depending on your locale.

I'm parsing for uppercase AM and uppercase PM only. Which works in the US. But Mark is in Canada, and if you're browsing from, for example Montreal, then it prints "a.m." in lower case with dots, and "pm" in lower case without dots. My parser needs to compensate for all of those possibilities.

This is hard to test in real-world, because in order to see the differing behavior, you can't just simply google for "sunrise Montreal". It doesn't change the formatting in that case. You have to use the LocationGuard plugin in your browser and spoof your location to see the difference.

tfabris commented 5 months ago

I'm going to fix this at the same time as I am implementing a proper/final fix to bug #81. Details in this EmpegBBS thread: https://empegbbs.com/ubbthreads.php/topics/374308

tfabris commented 5 months ago

Fixed in checkin 2f3ce99