#!/bin/bash # getdope--Grabs the latest column of "The Straight Dope." # Set it up in cron to be run every day, if so inclined. setglobal now = $[date +%y%m%d] setglobal start = '"http://www.straightdope.com/ '" setglobal to = '"testing@yourdomain.com'" # Change this as appropriate. # First, get the URL of the current column. setglobal URL = $[curl -s $start | \ grep -A1 'teaser' | sed -n '2p' | \ cut -d'"' -f2 | cut -d'"' -f1] # Now, armed with that data, produce the email. shell { cat << """ Subject: The Straight Dope for $[date "+%A, %d %B, %Y] From: Cecil Adams Content-type: text/html To: $to """ curl $URL } | /usr/sbin/sendmail -t exit 0