#!/bin/bash # # v0.2 / TK # # # Word lists: https://github.com/verachell/English-word-lists-parts-of-speech-approximate # # https://raw.githubusercontent.com/verachell/English-word-lists-parts-of-speech-approximate/main/nouns/mostly-nouns.txt # https://raw.githubusercontent.com/verachell/English-word-lists-parts-of-speech-approximate/main/other-categories/mostly-adjectives.txt # https://raw.githubusercontent.com/verachell/English-word-lists-parts-of-speech-approximate/main/verbs/mostly-verbs-infinitive.txt # # random word to array word=($(cat mostly* | tr 'A-Z' 'a-z' | egrep '^[a-z]{6}$' | shuf | head -1 | fold -w1)) # array elements will be replaced one by one finalword=(_ _ _ _ _ _) for i in $(echo "012345" | fold -w1 | shuf); do # replacing finalword[$i]=${word[$i]} reveal=$(echo ${finalword[@]} | sed 's/ //g') # data to telegram # curl -s -X POST "https://api.telegram.org/botNNNNNNNNNN:KEYYYYYY/sendMessage" -d "chat_id=XXXXXXXXX&text=Word puzzle with one minute delay: $reveal" > /dev/null # sleep 60 # for debugging echo $reveal done