Skip to content

Instantly share code, notes, and snippets.

@rkoopmann
Created February 21, 2022 21:02
Show Gist options
  • Save rkoopmann/b8209e0f15f866e5a66315076d650e98 to your computer and use it in GitHub Desktop.
Save rkoopmann/b8209e0f15f866e5a66315076d650e98 to your computer and use it in GitHub Desktop.
scraping NPR's tiny desk concert archives
#!/bin/bash
rm -f ~/dev/tiny-desk-concerts.txt
for y in {2008..2021}; do
echo "${y}"
for m in {1..12}; do
echo "${m}"
curl -s "https://www.npr.org/series/tiny-desk-concerts/archive?date=${m}-31-${y}" \
| htmlq 'h2.title' >> ~/dev/tiny-desk-concerts.txt
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment