Skip to content

Instantly share code, notes, and snippets.

@silentbicycle
Created February 25, 2013 16:55
Show Gist options
  • Save silentbicycle/5031244 to your computer and use it in GitHub Desktop.
Save silentbicycle/5031244 to your computer and use it in GitHub Desktop.
glue rapbot to say(1)
#!/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}
@silentbicycle
Copy link
Author

(This breaks out the plaintext version from the twitter share link, and adds periods after each line so say pauses.)

@dariusk
Copy link

dariusk commented Feb 25, 2013

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