Skip to content

Instantly share code, notes, and snippets.

@Guillawme
Forked from DustinMorado/get_all_3dem.sh
Last active September 23, 2022 11:08
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 Guillawme/06d884c4b9536217e14ff3b9b21aec47 to your computer and use it in GitHub Desktop.
Save Guillawme/06d884c4b9536217e14ff3b9b21aec47 to your computer and use it in GitHub Desktop.
Download all chimerax-users mailing list archives
#!/usr/bin/env bash
if [[ ! -d chimerax-users ]]
then
mkdir chimerax-users
fi
cd chimerax-users
curl -s https://www.rbvi.ucsf.edu/pipermail/chimerax-users/ |\
grep -o "2[0-9]\+-[A-Z][a-z]\+\.txt" |\
while read input_url
do
output_txt=$(basename ${input_url} .gz |\
sed -e 's/January/01/' \
-e 's/February/02/' \
-e 's/March/03/' \
-e 's/April/04/' \
-e 's/May/05/' \
-e 's/June/06/' \
-e 's/July/07/' \
-e 's/August/08/' \
-e 's/September/09/' \
-e 's/October/10/' \
-e 's/November/11/' \
-e 's/December/12/')
curl -s https://www.rbvi.ucsf.edu/pipermail/chimerax-users/${input_url} > ${output_txt}
done
find . -name '????-??.txt' | sort -t- -n -k1,2 | xargs cat > chimerax-users.txt
find . -name '????-??.txt' -delete
cd ..
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment