News for hackers. Stuff that matters.
Re:Show HN: A live map of sunlight on earth by kmano8 on Wednesday June 26, 2019 @10:39AM (#20285421)
Tangentially related plug for a small site I built to tell you when golden hour is at your location https://whenisgoldenhour.com/ [1]

Would love to figure out how to incorporate a world dot map like this, but showing the two current golden hours (morning and evening) instead.

[1] https://github.com/ksho/whenisgoldenhour.com/

Re:Show HN: A live map of sunlight on earth by arethuza on Wednesday June 26, 2019 @10:58AM (#20285599)
Out of interest - how are you getting location? I didn't get a consent warning for client side geolocation and it seems accurate so it doesn't appear to be IP based (my public IP appears to be a few hundred miles south of my actual location).
Re:Show HN: A live map of sunlight on earth by kmano8 on Wednesday June 26, 2019 @11:02AM (#20285664)
I'm using the google geolocation API https://developers.google.com/maps/documentation/geolocation... at https://github.com/ksho/whenisgoldenhour.com/blob/master/pag...

I've gone back and forth on replacing this with a browser-based location request so the user is aware what's going on -- the tradeoff being the friction of clicking the allow button.

Re:Show HN: A live map of sunlight on earth by SpikedCola on Wednesday June 26, 2019 @11:05AM (#20285700)
Appears to be using google's geocoder [0]

My location resolved a province over, so I suspect it is at least somewhat IP-based (or IP + some other magic)

[0] https://github.com/ksho/whenisgoldenhour.com/blob/3c0d7f0acf...

Re:Show HN: A live map of sunlight on earth by headsupernova on Wednesday June 26, 2019 @11:04AM (#20285685)
Looks like it's using Google's geolocation API: https://developers.google.com/maps/documentation/geolocation...
Re:Show HN: A live map of sunlight on earth by gregmac on Wednesday June 26, 2019 @11:02AM (#20285654)
Re:Show HN: A live map of sunlight on earth by verandacoffee on Wednesday June 26, 2019 @11:24AM (#20285898)
I get 10:26pm until NaN:NaNpm Probably because I am in Northern Norway (Midnight Sun).
Re:Show HN: A live map of sunlight on earth by kmano8 on Wednesday June 26, 2019 @11:28AM (#20285939)
Whoa yeah, that bug makes sense. Thanks!