Created
February 25, 2013 16:55
-
-
Save silentbicycle/5031244 to your computer and use it in GitHub Desktop.
glue rapbot to say(1)
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/sh | |
VOICE="-v fred" | |
#VOICE="-v ralph" | |
#VOICE="-v lee" | |
curl http://rapbot.jit.su/ 2>/dev/null | awk ' | |
{ | |
for (i=1; i<NF; i++) { | |
if (match($i, "twitter.com/share")) { | |
p = 1 | |
sub(".*text=", "") | |
printf("%s ", $(i - 1)) | |
} | |
if ($i == "/") { | |
printf(".\n", $i) | |
} else if (match($i, "#RapBot")) { | |
printf(".\n\n"); p = 0 | |
} else if (p) printf("%s ", $i) | |
} | |
} | |
' > .rap.temp | |
cat .rap.temp | say ${VOICE} |
Haha, nice. I've got a branch with TTS working...
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
(This breaks out the plaintext version from the twitter share link, and adds periods after each line so say pauses.)