Last active
November 16, 2024 06:14
-
-
Save fu-sen/d9ad43a042b57fe98143b92fc7b68028 to your computer and use it in GitHub Desktop.
Nostr スジャータ時報 bot - npub1sujataln45lwfkt5v9yllcqwj49uj0wdu2tg240ef03fw7ae3vyst3f8nq - https://nostter.app/sujahta@balloon-jp.vercel.app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
# install algia ( https://github.com/mattn/algia ) | |
# mv config-sujahta.json ~/.config/algia/ | |
# (or MOVE config-sujahta.json ~\AppData\Roaming\algia\) | |
# ( config.json の詳細は https://gist.github.com/fu-sen/360d6d08ebffdb97e1472859ab242cf8 ) | |
# crontab -e | |
# 59 * * * * ~~~/nostr-sujahta.sh (毎時 59 分) | |
set -e | |
NEXT_HOURS=`TZ='Asia/Tokyo' date +'%-H' -d "1 hour"` | |
sleep 44 | |
#STYLE=$(($(od -vAn -N4 -tu4 < /dev/urandom) % 6)) | |
#STYLE=$((RANDOM % 6)) | |
#だと同じ数字が出ていたので代わりに…… | |
STYLE=$((RANDOM / (32768 / 6))) | |
case ${STYLE} in | |
1) | |
algia -a sujahta n "🎵スジャータ スジャータ" "褐色の恋人 スジャータのめいらくが ${NEXT_HOURS} 時をお知らせします" | |
;; | |
2) | |
algia -a sujahta n "🎵スジャータ スジャータ コーヒーにスジャータ" "スジャータが ${NEXT_HOURS} 時をお知らせします" | |
;; | |
3) | |
algia -a sujahta n "🎵スジャータ スジャータ" "スジャータのめいらくが ${NEXT_HOURS} 時をお知らせします" | |
;; | |
*) | |
algia -a sujahta n "🎵スジャータ スジャータ 白い広がりスジャータ" "スジャータが ${NEXT_HOURS} 時をお知らせします" | |
;; | |
esac | |
sleep 14 | |
algia -a sujahta n "${NEXT_HOURS}:00 ポォ~ン♪" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment