Last active
August 29, 2015 14:02
-
-
Save brainstorm/de2904e0807c0f436d0b to your computer and use it in GitHub Desktop.
piperget.sh: Fetching pipermail gzipped archives and converting them to .mbox format
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/sh | |
# Usage: piperget.sh https://mail.nmr.mgh.harvard.edu/pipermail/freesurfer/ | |
# automated retrieval of pipermail archives & conversion to mbox file | |
# Last edit: 2012/10/09 Tue 23:16 PDT | |
listname=$(echo "$1" | sed 's:^\(http.*\)/\([^/]*\)/$:\2:') | |
cd /tmp | |
wget -r -l 1 -nH -A *.txt.gz "$1" | |
touch /tmp/pipermail/$listname/$listname.mbox | |
chmod 600 /tmp/pipermail/$listname/$listname.mbox | |
cd /tmp/pipermail/$listname | |
for f in $(ls |sort) | |
do gzcat $f | iconv -f iso8859-15 -t utf-8 | sed 's/\(^From.*\)\ at\ /\1@/' >> "$listname.mbox" | |
done | |
#rm /tmp/pipermail/$listname/*.gz | |
mutt -f /tmp/pipermail/$listname/$listname.mbox |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment