|
Wootoff Bag of Crap Alarm - A bash Script |
|
Thursday, 23 October 2008 |
This is an old version. Get the new one here.
I wrote this little puppy to wake me up if I'm asleep and the Bag of Crap comes up during a Wootoff (like the one going on now) at Woot. It's simple to use, it keeps looping, just outputting the current item. Feel free to mod it as you wish...I've really been meaning to make it look nice with color, but I figured it would'nt matter anyway.
That being the case, you can grab the tarball below. Otherwise, the source is below that. Just make sure to have an alarm.mp3 in the same directory as the script before your run it.
Source:
#!/bin/bash
#Wootwatch Alarm
#Written by Matt Parnell/ilikenwf http://www.mattparnell.com
#This is totally free, take it and mod it however you wish, under the GNU.
#This script goes every 5 sec to woot and checks for a bag of crap. If found, it sounds an alarm.
clear &
i=0
r=0
while [ $i -lt "1" ]
do
r=`expr $r + 1` ITEM=`/usr/bin/curl -s -f http://www.woot.com/DefaultMicrosummary.ashx`
echo ""
if echo $ITEM | grep "Crap"; then
play -q alarm.mp3 &
echo ""
echo "BOC FOUND after $r runs." else
echo "No BOC found yet..." echo ""
echo "Current item: "
echo $ITEM
echo ""
echo "This script has run $r Times." sleep 3 && clear
fi
done
exit
|