Skip to content

Instantly share code, notes, and snippets.

@cmheisel
Last active April 27, 2017 23:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cmheisel/13585e30ced4829e31be0fd0943e6761 to your computer and use it in GitHub Desktop.
Save cmheisel/13585e30ced4829e31be0fd0943e6761 to your computer and use it in GitHub Desktop.
Web site comparisons
#!/bin/bash
set -eou pipefail
cd /home/cmheisel/webapps/isittikiseason_static/mc
URL="https://mailchimp.com/about/jobs/all/"
DATADIR="./data"
DIFFDIR="./diffs"
DATE=`date +%Y-%m-%d_%H-%M-%S`
mkdir -p ${DATADIR}
mkdir -p ${DIFFDIR}
wget -O ${DATADIR}/index.html --quiet https://mailchimp.com/about/jobs/all/
if [ -a ${DATADIR}/previous.html ]; then
is_diff=$(diff ${DATADIR}/index.html ${DATADIR}/previous.html || true)
if [ -z "${is_diff}" ]; then
# No Diff found this period
true
else
echo "${is_diff}" > ${DIFFDIR}/diff-${DATE}.diff
cp ${DATADIR}/index.html ${DATADIR}/index-${DATE}.html
echo "${is_diff}"
fi
elif [ -a ${DATADIR}/index.html ]; then
cp ${DATADIR}/index.html ${DATADIR}/index-${DATE}.html
fi
cp ${DATADIR}/index.html ${DATADIR}/previous.html
echo "${DATE}" > jobs.lastrun
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment