#!/bin/sh PAGE="${1}" TEXT="${2}" OUTF="googlecheck-tmp.$$" if [ "${PAGE}X" = "X" ]; then echo "Usage: ${0} URL [TARGET_STRING]" echo "" echo "Fetch the page at URL, impersonating Googlebot." echo "If TARGET_STRING, grep for it in the result; otherwise just" echo "print the result to stdout." exit 1 fi wget ${1} \ --user-agent="Googlebot/2.1 (+http://www.googlebot.com/bot.html)" \ --output-document=${OUTF} if [ "${TEXT}X" != "X" ]; then grep ${TEXT} ${OUTF} else cat ${OUTF} fi echo "" echo "" echo "${0}: results saved in ${OUTF}" echo ""