Skip to main content
edited body
Source Link
Stephen Ostermiller
  • 99.4k
  • 18
  • 141
  • 364

Its pretty easy to do with a little bit of shell scripting. Here is a script uses bash, wget, and diff to download two urls (specified on the command line) and print out the differences.

#!/bin/bash
set -e
url1=$1
url2=$2
if [[ "$url1" != http* ]]
then
   echo "Bad url: $url1"
fi
if [[ "$url2" != http* ]]
then
   echo "Bad url: $url2"
fi
file1=`wget -x $url1 2>&1 | grep 'Saving to' | sed "s/^Saving to: .//g;s/.$//g"`
file2=`wget -x $url2 2>&1 | grep 'Saving to' | sed "s/^Saving to: .//g;s/.$//g"`
diff -u $file1 $file2

You could call this with a list of pages on the site.

Alternately, you could use wget to download both sites entirely and then do a diff of the entire directory structure created.

wget -Rxrx http://old.example.com/
wget -Rxrx http://new.example.com/
diff -u old.example.com new.example.com

I tested this on a machine running Ubuntu Linux. It should be trivial to get to work on other Linux variants. You much just have to install wget or diff. Under Windows you could run it under Cygwin. Should be able to get it to work under OS X as well, but I don't know the details.

Its pretty easy to do with a little bit of shell scripting. Here is a script uses bash, wget, and diff to download two urls (specified on the command line) and print out the differences.

#!/bin/bash
set -e
url1=$1
url2=$2
if [[ "$url1" != http* ]]
then
   echo "Bad url: $url1"
fi
if [[ "$url2" != http* ]]
then
   echo "Bad url: $url2"
fi
file1=`wget -x $url1 2>&1 | grep 'Saving to' | sed "s/^Saving to: .//g;s/.$//g"`
file2=`wget -x $url2 2>&1 | grep 'Saving to' | sed "s/^Saving to: .//g;s/.$//g"`
diff -u $file1 $file2

You could call this with a list of pages on the site.

Alternately, you could use wget to download both sites entirely and then do a diff of the entire directory structure created.

wget -Rx http://old.example.com/
wget -Rx http://new.example.com/
diff -u old.example.com new.example.com

I tested this on a machine running Ubuntu Linux. It should be trivial to get to work on other Linux variants. You much just have to install wget or diff. Under Windows you could run it under Cygwin. Should be able to get it to work under OS X as well, but I don't know the details.

Its pretty easy to do with a little bit of shell scripting. Here is a script uses bash, wget, and diff to download two urls (specified on the command line) and print out the differences.

#!/bin/bash
set -e
url1=$1
url2=$2
if [[ "$url1" != http* ]]
then
   echo "Bad url: $url1"
fi
if [[ "$url2" != http* ]]
then
   echo "Bad url: $url2"
fi
file1=`wget -x $url1 2>&1 | grep 'Saving to' | sed "s/^Saving to: .//g;s/.$//g"`
file2=`wget -x $url2 2>&1 | grep 'Saving to' | sed "s/^Saving to: .//g;s/.$//g"`
diff -u $file1 $file2

You could call this with a list of pages on the site.

Alternately, you could use wget to download both sites entirely and then do a diff of the entire directory structure created.

wget -rx http://old.example.com/
wget -rx http://new.example.com/
diff -u old.example.com new.example.com

I tested this on a machine running Ubuntu Linux. It should be trivial to get to work on other Linux variants. You much just have to install wget or diff. Under Windows you could run it under Cygwin. Should be able to get it to work under OS X as well, but I don't know the details.

Source Link
Stephen Ostermiller
  • 99.4k
  • 18
  • 141
  • 364

Its pretty easy to do with a little bit of shell scripting. Here is a script uses bash, wget, and diff to download two urls (specified on the command line) and print out the differences.

#!/bin/bash
set -e
url1=$1
url2=$2
if [[ "$url1" != http* ]]
then
   echo "Bad url: $url1"
fi
if [[ "$url2" != http* ]]
then
   echo "Bad url: $url2"
fi
file1=`wget -x $url1 2>&1 | grep 'Saving to' | sed "s/^Saving to: .//g;s/.$//g"`
file2=`wget -x $url2 2>&1 | grep 'Saving to' | sed "s/^Saving to: .//g;s/.$//g"`
diff -u $file1 $file2

You could call this with a list of pages on the site.

Alternately, you could use wget to download both sites entirely and then do a diff of the entire directory structure created.

wget -Rx http://old.example.com/
wget -Rx http://new.example.com/
diff -u old.example.com new.example.com

I tested this on a machine running Ubuntu Linux. It should be trivial to get to work on other Linux variants. You much just have to install wget or diff. Under Windows you could run it under Cygwin. Should be able to get it to work under OS X as well, but I don't know the details.