[Remind-Fans] Earth Seasons

Steve Jones Steve.Jones at rslegal.com
Fri Nov 2 11:47:27 EDT 2018


The Earth Seasons page on the wiki is a lookup table downloaded from the U.S. Navy from quite a while back, the Navy has gone to a computation model and now can give a list generated for some specific year, for at least 50 years into the future, and with more precise times than the old list had.

I wrote a script that uses links (or elinks) to update that list, and the end result is that it produces the reminder lines directly;

### Begin Script
#!/bin/bash
# The list of sun positions below is from the Astronomical Applications 
# Department of the U.S. Naval Observatory 
#  
File=$(mktemp)
for Year in $(seq 2018 2068) 
do
links "https://dianne.skoll.ca/canit/urlproxy.php?_q=aHR0cDovL2FhLnVzbm8ubmF2eS5taWwvc2Vhc29ucz95ZWFyPSQ%3D&_s=bm9saW5rcw%3D%3D&_c=56a2b4d9{Year}&tz=0&dst=0" -dump \
	| grep -E 'helion|quinox|olstice' \
	| sed -e 's/  */ /g' -e 's/^ *\(.*\) *$/\1/' \
	>> ${File}
done

while read Event Year Month Day Time 
do 
   Comd=$(echo ${Time} | tr ":" ",") 
   echo "REM [trigger(date("${Year}","${Month}","${Day}"), time("${Comd}"), 1)] MSG "${Event} ; 
   echo
done < ${File} >> ~/.Season_reminders
rm ${File}
### End Script


head ~/.Season_reminders
REM [trigger(date(2018,Jan,03), time(05,35), 1)] MSG Perihelion
REM [trigger(date(2018,Mar,20), time(16,15), 1)] MSG Equinox
REM [trigger(date(2018,Jun,21), time(10,07), 1)] MSG Solstice
REM [trigger(date(2018,Jul,06), time(16,47), 1)] MSG Aphelion
REM [trigger(date(2018,Sep,23), time(01,54), 1)] MSG Equinox
REM [trigger(date(2018,Dec,21), time(22,23), 1)] MSG Solstice

REM [trigger(date(2019,Jan,03), time(05,20), 1)] MSG Perihelion
REM [trigger(date(2019,Mar,20), time(21,58), 1)] MSG Equinox
REM [trigger(date(2019,Jun,21), time(15,54), 1)] MSG Solstice


I am curious that I had to convert the : to a , in the time variable.

Thank you!
Steve Jones (Linuxmonger)



More information about the Remind-fans mailing list