#!/bin/bash if [ -z "$1" -o ! -d "$1" ]; then echo "Usage: $0 []" 1>&2 exit 1 fi top="${1}" shift source "${top}/etc/settings.sh" tmp="$(mktemp -d)" cd "${tmp}" export LC_ALL=C searchdate="$(date -d "$daysago days ago" "+%b %d, %Y")" echo "searching on $searchdate" posturl="$(wget -O - http://jeremykaye.tumblr.com/archive | sed -nre "s#.*(http://[^\"]+)\">.+post_date\">${searchdate}.*#\1#p")" echo "post url: $posturl" if [ -n "$posturl" ]; then read URL TITLE <