chinese-newyear-cronjob - annna - Annna the nice friendly bot.
HTML git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/annna/
DIR Log
DIR Files
DIR Refs
DIR Tags
DIR README
---
chinese-newyear-cronjob (653B)
---
1 #!/bin/sh
2
3 #set -x
4
5 export PATH="$PATH:/home/annna/bin"
6
7 chinesenewyear="$($HOME/.local/bin/lunar-find 春节 | cut -d: -f2 | cut -c 2- | ansifilter)"
8 cnyprior="$(date -d "$chinesenewyear - 1 day" +"%Y-%m-%d")"
9 cnypriorprior="$(date -d "$chinesenewyear - 2 day" +"%Y-%m-%d")"
10 curdate="$(LANG=C date -I)"
11 if [ "${curdate}" = "${cnypriorprior}" ];
12 then
13 annna-say -s "irc.bitreich.org" -c "#bitreich-en" "One day until Chinese New Year!"
14
15 #countdownd "$(date -d "+ 1 day" -I)" "#bitreich-en" "Chinese New Year"
16 fi
17
18 if [ "${curdate}" = "${cnyprior}" ];
19 then
20 annna-say -s "irc.bitreich.org" -c "#bitreich-en" "Today is a Chinese New Year! Celebrate!"
21 fi
22