Created
August 1, 2018 04:38
-
-
Save bikubi/87d5573c1d6a9eb664e9b1fd9631057a to your computer and use it in GitHub Desktop.
Correct Horse Battery: The Band
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 | |
# 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