#!/bin/sh
BLACKLIST="bundle|Currently no item|sears\.com"

while true; do
	echo "Updating..."
	WIILIST="`curl -A "findwii 0.1" -s http://www.xpbargains.com/wii_rss.php | egrep '<title>|<link>' | tail -n +5 | tr -d '\r\n' | sed -r 's@</?title>@@g;s@<link>@ -- @g;s@</link>@\n@g;s@&amp;@\&@g' | egrep -iv "$BLACKLIST" | tr '\n' '	' | sed 's@ -- @\n@g;s@	@\n\n@g'`"

	if [ ! -z "$WIILIST" ]; then
		echo "Found items!"
		xmessage "$WIILIST"
	fi
	echo "Sleeping..."
	sleep 5m
done
