sxiii

Funtalk - FuckingGreatAdvice

Aug 13th, 2011
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.70 KB | None | 0 0
  1. #!/bin/bash
  2. # Funtalk - download text & sound from fucking-great-advice.ru
  3.  
  4. MP3PATH="/root/funtalk/mp3"
  5.  
  6. function play {
  7. fulltext=$(/usr/bin/printf "$(curl -s http://fucking-great-advice.ru/api/random) --silent >/dev/null 2>&1")
  8. text=$(echo $fulltext | awk -F\" {' print $8 '})
  9. name=$(echo $fulltext | awk -F\" {' print $12 '})
  10. namenoext=$(echo $name | awk -F. {' print $1'})
  11.  
  12. if [ -f $MP3PATH/$name ]
  13. then
  14. echo $text
  15. echo $name
  16. mpg321 -q $MP3PATH/$name
  17. play
  18. else
  19. echo $text
  20. echo $name
  21. wget http://fucking-great-advice.ru/files/sounds/$name -O $MP3PATH/$name --quiet >/dev/null 2>&1
  22. touch $MP3PATH/$namenoext.txt
  23. echo $text > $MP3PATH/$namenoext.txt
  24. mpg321 -q $MP3PATH/$name
  25. play
  26. fi
  27.  
  28. }
  29.  
  30. play
Advertisement
Add Comment
Please, Sign In to add comment