Verifying Students have Posted to the Newsgroup

WARNING! This document should be considered transitional; it will need to be edited as it is confirmed fixed up and translated appropriately for BitterSuite.

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:

  • Using #!/usr/bin/env bash as the language; the Solaris /bin/bash is ancient, and a newer one will be selected from the PATH.
  • Ensuring this script is in the same directory as 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...

Topic attachments
I Attachment History Action Size Date Who Comment
Texttxt newsarchiver.py.txt r1 manage 5.7 K 2009-07-23 - 14:15 TerryVaskor Utility that will download newsgroup articles
Edit | Attach | Watch | Print version | History: r5 | r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r1 - 2009-07-23 - TerryVaskor
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback