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.
whoami
to avoid hard-coding in a particular course name.
The test.exe
program can then take an action similar to the following:
#!/usr/bin/env bash POSTS="/u/$course/newsgroup/a0_done" if [ `grep $student $POSTS | wc -w` -gt 0 ]; then echo '100' >&3 echo "The appropriate email address was used for a newsgroup post." else echo '0' >&3 echo "An e-mail from $student's uwaterloo address was not found on the newsgroup." fi
This will need to be verified in 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 |