A utility that will download posts from a newsgroup, newsarchiver.py
, is attached to this document (the Wiki insists on appending .txt
... just rename it). It will be wrapped by a program similar to the following:
#!/bin/bash export PATH=`/bin/showpath gnu standard` cd /u/cs135/newsgroup ./newsarchiver.py uw.cs.cs135 >/dev/null tmpfile=a0_late.$$ realfile=a0_late grep '^From: ' `grep -l '^References:$' *`\ | perl -lne 'print $1 if /\<(.*?)@.*uwaterloo\.ca\>/' > $tmpfile mv $tmpfile $realfile
Changes that can/should likely be made include:
#!/usr/bin/env bash
as the language; the Solaris /bin/bash
is ancient, and a newer one will be selected from the PATH.
newsarchiver.py
(which it was anyway), so that the cd
line should be able to be changed to the less fragile cd $(dirname $0)
.
sed 's/late/done/g'
? The marking script seems to look for done; this was likely a mid-term modification so students could continue submitting to the assignment after the deadline.
The provided script can then take an action similar to the following:
# Newsgroup post POSTS="/u/cs135/newsgroup/a0_done" t6=0 if [ `grep $student $POSTS | wc -w` -gt 0 ]; then t6=1 echo "The appropriate email address was used for newsgroup." >> $marksheet else echo "The wrong email address was used for newsgroup." >> $marksheet fi
This will need to be updated for BitterSuite once the proper facilities are built in...
I | Attachment | History | Action | Size | Date | Who | Comment |
---|---|---|---|---|---|---|---|
![]() |
newsarchiver.py.txt | r1 | manage | 5.7 K | 2009-07-23 - 14:15 | TerryVaskor | Utility that will download newsgroup articles |