[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Sunrise and Sunset from terminal



On 24/09/2023 00:04, Greg Wooledge wrote:
By the way, do you know what tool does NOT parse HTML correctly?
A mashup of grep, awk and sed.  Seriously, don't do this, ever.

I don't care, it works for me perfectly well. My own city, and every
other I tried.

Random city:
$ head -n 3 suntimes.sh | tail -n 1 && ./suntimes.sh
SunTimes=$(curl --silent
"https://www.timeanddate.com/sun/germany/berlin"; 2>/dev/null)
Sunrise Today: 06:55
Sunset Today: 19:01

$ head -n 3 suntimes.sh | tail -n 1 && ./suntimes.sh
SunTimes=$(curl --silent
"https://www.timeanddate.com/sun/australia/sydney"; 2>/dev/null)
Sunrise Today: 05:42
Sunset Today: 17:52

Enough for my Raspberry Pi controlled garden lights to turn on at dusk
and turn off at dawn. And it's been like that for last 2 years without a
single fail.

You want any better? Write it yourself.

--
With kindest regards, Piotr.

⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org/
⠈⠳⣄⠀⠀⠀⠀


Reply to: