Skip to content

Instantly share code, notes, and snippets.

@bikubi
Created August 1, 2018 04:38
Show Gist options
  • Save bikubi/87d5573c1d6a9eb664e9b1fd9631057a to your computer and use it in GitHub Desktop.
Save bikubi/87d5573c1d6a9eb664e9b1fd9631057a to your computer and use it in GitHub Desktop.
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