1234567891011121314151617181920212223242526272829303132333435363738 |
- #!/bin/bash
- #
- # CONFIGURATION
- #
- # Interval between two consecutive posts
- SLEEP_INTERVAL=3h
- # File containing the toots to post
- DATA_FILE=test.txt
- # A prefix for all toots of this bot
- TOOT_PREFIX="#avviso%0A"
- #
- # CONFIGURATION END
- #
- extract_image() {
- sed -n -e 's/.*<img>\(.*\)<\/img>.*/\1/p' <<< $1
- }
- extract_text() {
- sed -e "s/<img>.*<\/img>/ /g" <<< $1
- }
- while :
- do
- # Last line should be empty, so we dont need an additional read here
- # after the while loop
- while read line
- do
- ./toot.sh $line
- sleep ${SLEEP_INTERVAL}
- done < ${DATA_FILE}
- done
|