Created
August 3, 2014 15:16
-
-
Save phosphore/aed522da0a50602b8c19 to your computer and use it in GitHub Desktop.
A simple bash script that uses google's tts service to notify new emails. [IT-it]
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
#!/bin/bash | |
rm /home/pi/bash/tmp/atom | |
wget --no-check-certificate -q -P/home/pi/bash/tmp/ https://user:[email protected]/mail/feed/atom | |
email=$((`perl -ne 'while(/author/g){++$count}; print "$count\n"' /home/pi/bash/tmp/atom`/2)) | |
sender=`grep -oPm1 "(?<=<name>)[^<]+" /home/pi/bash/tmp/atom | tr '\n' ','` | |
echo $sender | |
if [ "$email" == 1 ]; then | |
email=$email | |
mpg123 -q attention.mp3 | |
/bin/bash ./speech2text.sh "C'è una nuova mail da $sender ." | |
elif [ -n "$email" ]; then | |
email=$email | |
mpg123 -q attention.mp3 | |
/bin/bash ./speech2text.sh "Ci sono $email nuove mail da: $sender ." | |
email=0 | |
fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment