If you have some affiliate links and are concerned about their presence then you can setup cron to check the links for you regularly. For this you need a very simple script (as below) and a cron entry (example further down).
#!/bin/bash –
#===============================================================================
#
# FILE: checklinks.sh
#
# USAGE: ./checklinks.sh
#
# DESCRIPTION: Check if the links exists on affiliate sites
#
# OPTIONS: —
# REQUIREMENTS: —
# BUGS: —
# NOTES: —
# AUTHOR: Amit Agarwal (AKA), amit.agarwal@amit-agarwal.co.in
# COMPANY: Individual
# VERSION: 1.0
# CREATED: 04/07/2010 08:19:29 AM IST
# REVISION: —
#===============================================================================websites=\”space seperated website address like http://amit-agarwal.co.in http://blog.amit-agarwal.co.in\”
echo \”Checking the sites for Links\”
echo $websites|tr \’ \’ \’\\n\’
echo
echo
for i in $websites
do
curl -s $i |grep amit-agarwal.co.in > /dev/null
if [ $? != 0 ]
then
echo \”Link not found on $i\”
fi
done
Then make a crontab entry like this:
40 08 * * * (echo \”Subject: Link verification on affiliate sites @ `date`\”;<fullpath>/checklinks.sh) |/usr/sbin/sendmail <email>
Related articles by Zemanta
- Email web statistics from the hosted website using awstats page. (amit-agarwal.co.in)
- Bing\’s Wallpaper Search Feature (on10.net)
- bash script with sql to get the number of records from multiple tables. (amit-agarwal.co.in)
- Variably Safe For Work Previews Questionable Links, Keeps You Out of Trouble (lifehacker.com)
- email with templates (with variables) from the command line with sendmail or any other MTA. (amit-agarwal.co.in)