Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Funtalk - download text & sound from fucking-great-advice.ru
- MP3PATH="/root/funtalk/mp3"
- function play {
- fulltext=$(/usr/bin/printf "$(curl -s http://fucking-great-advice.ru/api/random) --silent >/dev/null 2>&1")
- text=$(echo $fulltext | awk -F\" {' print $8 '})
- name=$(echo $fulltext | awk -F\" {' print $12 '})
- namenoext=$(echo $name | awk -F. {' print $1'})
- if [ -f $MP3PATH/$name ]
- then
- echo $text
- echo $name
- mpg321 -q $MP3PATH/$name
- play
- else
- echo $text
- echo $name
- wget http://fucking-great-advice.ru/files/sounds/$name -O $MP3PATH/$name --quiet >/dev/null 2>&1
- touch $MP3PATH/$namenoext.txt
- echo $text > $MP3PATH/$namenoext.txt
- mpg321 -q $MP3PATH/$name
- play
- fi
- }
- play
Advertisement
Add Comment
Please, Sign In to add comment