Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Correct Horse Battery: The Band
#!/bin/bash
# see http://cyfta.com/band-name-y-3-word-combos-with-exactly-1-youtube-hit/ for what this is all about.
key="YOURYOUTUBEAPIKEY"
mkdir -v q
for s in {1..1000}; do
# generate "passwords"
words=$(grep -v '^[A-Z]' /usr/share/dict/american-english | grep -v "'s$" | shuf | head -n 3 | tr '\n' ' ' | sed -e 's/ $//')
fn="q/${words// /_}"
q="$(php -r "echo urlencode('$words');")"
url="https://www.googleapis.com/youtube/v3/search?key=$key&q=$q&part=id,snippet&safeSearch=none"
echo "$q -> $fn"
curl "$url" > "$fn"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment