Skip to content

Instantly share code, notes, and snippets.

@mic2100
Created March 29, 2019 19:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mic2100/c4655d4abfba979dbd1279e1e65a6c54 to your computer and use it in GitHub Desktop.
Save mic2100/c4655d4abfba979dbd1279e1e65a6c54 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
while read url; do
echo "$url"
re="soundcloud://users:([0-9]+)"
responseText=$(curl "$url" | grep soundcloud://users:)
if [[ $responseText =~ $re ]]; then
echo ${BASH_REMATCH[1]};
printf ${BASH_REMATCH[1]} >> codes.txt
printf "\n" >> codes.txt
else
echo "Not found: $url";
fi
done < urls.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment