-
-
Save StryKaizer/5613863 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Daisydiff script based on https://gist.github.com/c4rl/5385704 for unix users | |
# Required folder structure: | |
# - this script | |
# - daisydiff folder | |
# - tmp folder | |
# CONFIGURATION | |
USERNAME=youruser | |
PASSWORD=yourpass | |
ORIGINAL_D8_URL=http://d8clean.dev/ | |
PATCHED_D8_URL=http://d8.dev/ | |
AUTHENTICATE=true | |
# Get Basedir | |
BASEDIR=$(dirname $0) | |
echo $BASEDIR | |
# Clean up previous | |
rm $BASEDIR/daisydiff/daisydiff.htm | |
rm $BASEDIR/tmp/* | |
# Get command parameters | |
URL=$1 | |
if $AUTHENTICATE ; | |
then | |
# Authenticate | |
wget -O /dev/null --save-cookies $BASEDIR/tmp/cookies.d8clean.txt --post-data "name=$USERNAME&pass=$PASSWORD&op=Log%20in&form_id=user_login_form" $ORIGINAL_D8_URL | |
wget -O /dev/null --save-cookies $BASEDIR/tmp/cookies.d8.txt --post-data "name=$USERNAME&pass=$PASSWORD&op=Log%20in&form_id=user_login_form" $PATCHED_D8_URL | |
# Get output and pass cookies | |
wget $ORIGINAL_D8_URL$URL -O $BASEDIR/tmp/d8clean-tmp.html --load-cookies $BASEDIR/tmp/cookies.d8clean.txt | |
wget $PATCHED_D8_URL$URL -O $BASEDIR/tmp/d8.html --load-cookies $BASEDIR/tmp/cookies.d8.txt | |
else | |
# Get output, no authentication | |
wget $ORIGINAL_D8_URL$URL -O $BASEDIR/tmp/d8clean-tmp.html | |
wget $PATCHED_D8_URL$URL -O $BASEDIR/tmp/d8.html | |
fi | |
# Make domains similar | |
sed -e 's/d8clean/d8/g' $BASEDIR/tmp/d8clean-tmp.html > $BASEDIR/tmp/d8clean.html | |
# Daisydiff | |
cd $BASEDIR/daisydiff | |
java -jar daisydiff.jar $BASEDIR/../tmp/d8clean.html $BASEDIR/../tmp/d8.html | |
#Open result | |
xdg-open daisydiff.htm | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment