Created
August 20, 2011 06:00
-
-
Save RichardBronosky/1158733 to your computer and use it in GitHub Desktop.
Apache mod_rewrite unit tests
This file contains hidden or 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
ReUnit - Unit tests for HTTP Redirects. | |
# ATTENTION: Please do not think badly of me for this code! | |
# I REALLY WANT TO REDO THIS IN PYTHON AND USE YAML!!! | |
# It started out as a oneliner! https://gist.github.com/1158733/2f9aa7e2db9ccfbda4669c2102daebacf8a04284#L6 | |
Contents: | |
reunit.sh - This is the main script and the purpose of this repo. It reads a text file full of tests. | |
tests.txt - This holds the tests that will be run. It's format is Identical to the output of reunit.sh an urltest | |
urltest - This is the test utility used by reunit.sh. It was extracted into an executable so that it could be used for single tests or creating entries for tests.txt | |
Examples: | |
./reunit.sh tests.txt | |
./urltest http://google.com | |
# Define this for your convenience... | |
urltest() { for url in $@; do ./urltest $url; done } | |
# Then you don't have to use ./ and you can test multiple domains | |
urltest http://example.com http://google.com |
This file contains hidden or 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
#!/usr/bin/env bash | |
# ATTENTION: Please do not think badly of me for this code! | |
# I REALLY WANT TO REDO THIS IN PYTHON AND USE YAML!!! | |
# It started out as a oneliner! https://gist.github.com/1158733/2f9aa7e2db9ccfbda4669c2102daebacf8a04284#L6 | |
cat > /dev/stderr << EOF | |
# The first line in each block tells you the URL requested. | |
# The rest begin with the response's HTTP status code. (301=Permanent Redirect, 302=Temporary Redirect, etc.) | |
# The lines with 300 class responses have the URL of the Location header. | |
# The lines with 200, 400, or 500 class responses have the URL requested. | |
# I REALLY WANT TO REDO THIS IN PYTHON AND USE YAML!!! | |
EOF | |
rm /tmp/reunit.latest.txt /tmp/cookies.*.txt | |
echo "#### $(date) ####" > /tmp/reunit.latest.txt | |
while read line; do | |
# skip lines that do not begin with http | |
echo "$line" | grep -qE '^\s*http' || continue; | |
url="$line" | |
./urltest "$url" | tee -a /tmp/reunit.latest.txt | |
done < $1 | |
#diff -u $1 /tmp/reunit.latest.txt | tee /tmp/reunit.diff | |
vimdiff -n $1 /tmp/reunit.latest.txt | |
# the following command is useful for replacing an env component with a variable | |
# :.,$s/test\./${env}/ | |
#awk '/^http/{sub(".*://",""); sub("/.*",""); printf "%s ", $0}' tests.txt |
This file contains hidden or 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
#### test homepages #### | |
http://ajc.com/ | |
# Checking Firefox... | |
> 302 http://www.ajc.com/ | |
> 200 http://www.ajc.com/ | |
# Checking iPhone... | |
> 302 http://m.ajc.com/ | |
> 200 http://m.ajc.com/ | |
http://www.ajc.com/ | |
# Checking Firefox... | |
> 200 http://www.ajc.com/ | |
# Checking iPhone... | |
> 302 http://m.ajc.com/ | |
> 200 http://m.ajc.com/ | |
http://accessatlanta.com/ | |
# Checking Firefox... | |
> 302 http://www.accessatlanta.com/ | |
> 200 http://www.accessatlanta.com/ | |
# Checking iPhone... | |
> 302 http://m.accessatlanta.com/ | |
> 200 http://m.accessatlanta.com/ | |
http://www.accessatlanta.com/ | |
# Checking Firefox... | |
> 200 http://www.accessatlanta.com/ | |
# Checking iPhone... | |
> 302 http://m.accessatlanta.com/ | |
> 200 http://m.accessatlanta.com/ | |
http://daytondailynews.com/ | |
# Checking Firefox... | |
> 302 http://www.daytondailynews.com/ | |
> 200 http://www.daytondailynews.com/ | |
# Checking iPhone... | |
> 302 http://m.daytondailynews.com/ | |
> 200 http://m.daytondailynews.com/ | |
http://www.daytondailynews.com/ | |
# Checking Firefox... | |
> 200 http://www.daytondailynews.com/ | |
# Checking iPhone... | |
> 302 http://m.daytondailynews.com/ | |
> 200 http://m.daytondailynews.com/ | |
http://activedayton.com/ | |
# Checking Firefox... | |
> 302 http://www.activedayton.com/ | |
> 200 http://www.activedayton.com/ | |
# Checking iPhone... | |
> 302 http://m.activedayton.com/ | |
> 200 http://m.activedayton.com/ | |
http://www.activedayton.com/ | |
# Checking Firefox... | |
> 200 http://www.activedayton.com/ | |
# Checking iPhone... | |
> 302 http://m.activedayton.com/ | |
> 200 http://m.activedayton.com/ | |
http://journal-news.com/ | |
# Checking Firefox... | |
> 302 http://www.journal-news.com/ | |
> 200 http://www.journal-news.com/ | |
# Checking iPhone... | |
> 302 http://m.journal-news.com/ | |
> 200 http://m.journal-news.com/ | |
http://www.journal-news.com/ | |
# Checking Firefox... | |
> 200 http://www.journal-news.com/ | |
# Checking iPhone... | |
> 302 http://m.journal-news.com/ | |
> 200 http://m.journal-news.com/ | |
http://middletownjournal.com/ | |
# Checking Firefox... | |
> 302 http://www.middletownjournal.com/ | |
> 200 http://www.middletownjournal.com/ | |
# Checking iPhone... | |
> 302 http://m.middletownjournal.com/ | |
> 200 http://m.middletownjournal.com/ | |
http://www.middletownjournal.com/ | |
# Checking Firefox... | |
> 200 http://www.middletownjournal.com/ | |
# Checking iPhone... | |
> 302 http://m.middletownjournal.com/ | |
> 200 http://m.middletownjournal.com/ | |
http://oxfordpress.com/ | |
# Checking Firefox... | |
> 302 http://www.oxfordpress.com/ | |
> 200 http://www.oxfordpress.com/ | |
# Checking iPhone... | |
> 302 http://m.oxfordpress.com/ | |
> 200 http://m.oxfordpress.com/ | |
http://www.oxfordpress.com/ | |
# Checking Firefox... | |
> 200 http://www.oxfordpress.com/ | |
# Checking iPhone... | |
> 302 http://m.oxfordpress.com/ | |
> 200 http://m.oxfordpress.com/ | |
http://pulsejournal.com/ | |
# Checking Firefox... | |
> 302 http://www.pulsejournal.com/ | |
> 200 http://www.pulsejournal.com/ | |
# Checking iPhone... | |
> 302 http://m.pulsejournal.com/ | |
> 200 http://m.pulsejournal.com/ | |
http://www.pulsejournal.com/ | |
# Checking Firefox... | |
> 200 http://www.pulsejournal.com/ | |
# Checking iPhone... | |
> 302 http://m.pulsejournal.com/ | |
> 200 http://m.pulsejournal.com/ | |
http://springfieldnewssun.com/ | |
# Checking Firefox... | |
> 302 http://www.springfieldnewssun.com/ | |
> 200 http://www.springfieldnewssun.com/ | |
# Checking iPhone... | |
> 302 http://m.springfieldnewssun.com/ | |
> 200 http://m.springfieldnewssun.com/ | |
http://www.springfieldnewssun.com/ | |
# Checking Firefox... | |
> 200 http://www.springfieldnewssun.com/ | |
# Checking iPhone... | |
> 302 http://m.springfieldnewssun.com/ | |
> 200 http://m.springfieldnewssun.com/ | |
http://western-star.com/ | |
# Checking Firefox... | |
> 302 http://www.western-star.com/ | |
> 200 http://www.western-star.com/ | |
# Checking iPhone... | |
> 302 http://m.western-star.com/ | |
> 200 http://m.western-star.com/ | |
http://www.western-star.com/ | |
# Checking Firefox... | |
> 200 http://www.western-star.com/ | |
# Checking iPhone... | |
> 302 http://m.western-star.com/ | |
> 200 http://m.western-star.com/ | |
http://palmbeachpost.com/ | |
# Checking Firefox... | |
> 302 http://www.palmbeachpost.com/ | |
> 200 http://www.palmbeachpost.com/ | |
# Checking iPhone... | |
> 302 http://m.palmbeachpost.com/ | |
> 200 http://m.palmbeachpost.com/ | |
http://www.palmbeachpost.com/ | |
# Checking Firefox... | |
> 200 http://www.palmbeachpost.com/ | |
# Checking iPhone... | |
> 302 http://m.palmbeachpost.com/ | |
> 200 http://m.palmbeachpost.com/ | |
http://palmbeachdailynews.com/ | |
# Checking Firefox... | |
> 302 http://www.palmbeachdailynews.com/ | |
> 200 http://www.palmbeachdailynews.com/ | |
# Checking iPhone... | |
> 302 http://m.palmbeachdailynews.com/ | |
> 200 http://m.palmbeachdailynews.com/ | |
http://www.palmbeachdailynews.com/ | |
# Checking Firefox... | |
> 200 http://www.palmbeachdailynews.com/ | |
# Checking iPhone... | |
> 302 http://m.palmbeachdailynews.com/ | |
> 200 http://m.palmbeachdailynews.com/ | |
http://pbpulse.com/ | |
# Checking Firefox... | |
> 302 http://www.pbpulse.com/ | |
> 200 http://www.pbpulse.com/ | |
# Checking iPhone... | |
> 302 http://m.pbpulse.com/ | |
> 200 http://m.pbpulse.com/ | |
http://www.pbpulse.com/ | |
# Checking Firefox... | |
> 200 http://www.pbpulse.com/ | |
# Checking iPhone... | |
> 302 http://m.pbpulse.com/ | |
> 200 http://m.pbpulse.com/ | |
http://pbpost.com/ | |
# Checking Firefox... | |
> 301 http://www.palmbeachpost.com/ | |
> 200 http://www.palmbeachpost.com/ | |
# Checking iPhone... | |
> 301 http://m.palmbeachpost.com/ | |
> 200 http://m.palmbeachpost.com/ | |
http://www.pbpost.com/ | |
# Checking Firefox... | |
> 301 http://www.palmbeachpost.com/ | |
> 200 http://www.palmbeachpost.com/ | |
# Checking iPhone... | |
> 301 http://m.palmbeachpost.com/ | |
> 200 http://m.palmbeachpost.com/ | |
#### test site preference cookie #### | |
http://ajc.com/mobilesite?return=/ | |
# Checking Firefox... | |
> 302 http://m.ajc.com/ Set-Cookie: nmredir=false; | |
> 200 http://m.ajc.com/ | |
# Checking iPhone... | |
> 302 http://m.ajc.com/ Set-Cookie: nmredir=false; | |
> 200 http://m.ajc.com/ | |
http://ajc.com/fullsite?return=/ | |
# Checking Firefox... | |
> 302 http://www.ajc.com/?nmredir=true Set-Cookie: nmredir=true; | |
> 200 http://www.ajc.com/?nmredir=true | |
# Checking iPhone... | |
> 302 http://www.ajc.com/?nmredir=true Set-Cookie: nmredir=true; | |
> 200 http://www.ajc.com/?nmredir=true | |
http://ajc.com/mobilesite?return=/ | |
# Checking Firefox... | |
> 302 http://m.ajc.com/ Set-Cookie: nmredir=false; | |
> 200 http://m.ajc.com/ | |
# Checking iPhone... | |
> 302 http://m.ajc.com/ Set-Cookie: nmredir=false; | |
> 200 http://m.ajc.com/ | |
http://accessatlanta.com/mobilesite?return=/ | |
# Checking Firefox... | |
> 302 http://m.accessatlanta.com/ Set-Cookie: nmredir=false; | |
> 200 http://m.accessatlanta.com/ | |
# Checking iPhone... | |
> 302 http://m.accessatlanta.com/ Set-Cookie: nmredir=false; | |
> 200 http://m.accessatlanta.com/ | |
http://accessatlanta.com/fullsite?return=/ | |
# Checking Firefox... | |
> 302 http://www.accessatlanta.com/?nmredir=true Set-Cookie: nmredir=true; | |
> 200 http://www.accessatlanta.com/?nmredir=true | |
# Checking iPhone... | |
> 302 http://www.accessatlanta.com/?nmredir=true Set-Cookie: nmredir=true; | |
> 200 http://www.accessatlanta.com/?nmredir=true | |
http://accessatlanta.com/mobilesite?return=/ | |
# Checking Firefox... | |
> 302 http://m.accessatlanta.com/ Set-Cookie: nmredir=false; | |
> 200 http://m.accessatlanta.com/ | |
# Checking iPhone... | |
> 302 http://m.accessatlanta.com/ Set-Cookie: nmredir=false; | |
> 200 http://m.accessatlanta.com/ | |
http://daytondailynews.com/mobilesite?return=/ | |
# Checking Firefox... | |
> 302 http://m.daytondailynews.com/ Set-Cookie: nmredir=false; | |
> 200 http://m.daytondailynews.com/ | |
# Checking iPhone... | |
> 302 http://m.daytondailynews.com/ Set-Cookie: nmredir=false; | |
> 200 http://m.daytondailynews.com/ | |
http://daytondailynews.com/fullsite?return=/ | |
# Checking Firefox... | |
> 302 http://www.daytondailynews.com/?nmredir=true Set-Cookie: nmredir=true; | |
> 200 http://www.daytondailynews.com/?nmredir=true | |
# Checking iPhone... | |
> 302 http://www.daytondailynews.com/?nmredir=true Set-Cookie: nmredir=true; | |
> 200 http://www.daytondailynews.com/?nmredir=true | |
http://daytondailynews.com/mobilesite?return=/ | |
# Checking Firefox... | |
> 302 http://m.daytondailynews.com/ Set-Cookie: nmredir=false; | |
> 200 http://m.daytondailynews.com/ | |
# Checking iPhone... | |
> 302 http://m.daytondailynews.com/ Set-Cookie: nmredir=false; | |
> 200 http://m.daytondailynews.com/ | |
http://activedayton.com/mobilesite?return=/ | |
# Checking Firefox... | |
> 302 http://m.activedayton.com/ Set-Cookie: nmredir=false; | |
> 200 http://m.activedayton.com/ | |
# Checking iPhone... | |
> 302 http://m.activedayton.com/ Set-Cookie: nmredir=false; | |
> 200 http://m.activedayton.com/ | |
http://activedayton.com/fullsite?return=/ | |
# Checking Firefox... | |
> 302 http://www.activedayton.com/?nmredir=true Set-Cookie: nmredir=true; | |
> 200 http://www.activedayton.com/?nmredir=true | |
# Checking iPhone... | |
> 302 http://www.activedayton.com/?nmredir=true Set-Cookie: nmredir=true; | |
> 200 http://www.activedayton.com/?nmredir=true | |
http://activedayton.com/mobilesite?return=/ | |
# Checking Firefox... | |
> 302 http://m.activedayton.com/ Set-Cookie: nmredir=false; | |
> 200 http://m.activedayton.com/ | |
# Checking iPhone... | |
> 302 http://m.activedayton.com/ Set-Cookie: nmredir=false; | |
> 200 http://m.activedayton.com/ | |
http://journal-news.com/mobilesite?return=/ | |
# Checking Firefox... | |
> 302 http://m.journal-news.com/ Set-Cookie: nmredir=false; | |
> 200 http://m.journal-news.com/ | |
# Checking iPhone... | |
> 302 http://m.journal-news.com/ Set-Cookie: nmredir=false; | |
> 200 http://m.journal-news.com/ | |
http://journal-news.com/fullsite?return=/ | |
# Checking Firefox... | |
> 302 http://www.journal-news.com/?nmredir=true Set-Cookie: nmredir=true; | |
> 200 http://www.journal-news.com/?nmredir=true | |
# Checking iPhone... | |
> 302 http://www.journal-news.com/?nmredir=true Set-Cookie: nmredir=true; | |
> 200 http://www.journal-news.com/?nmredir=true | |
http://journal-news.com/mobilesite?return=/ | |
# Checking Firefox... | |
> 302 http://m.journal-news.com/ Set-Cookie: nmredir=false; | |
> 200 http://m.journal-news.com/ | |
# Checking iPhone... | |
> 302 http://m.journal-news.com/ Set-Cookie: nmredir=false; | |
> 200 http://m.journal-news.com/ | |
http://middletownjournal.com/mobilesite?return=/ | |
# Checking Firefox... | |
> 302 http://m.middletownjournal.com/ Set-Cookie: nmredir=false; | |
> 200 http://m.middletownjournal.com/ | |
# Checking iPhone... | |
> 302 http://m.middletownjournal.com/ Set-Cookie: nmredir=false; | |
> 200 http://m.middletownjournal.com/ | |
http://middletownjournal.com/fullsite?return=/ | |
# Checking Firefox... | |
> 302 http://www.middletownjournal.com/?nmredir=true Set-Cookie: nmredir=true; | |
> 200 http://www.middletownjournal.com/?nmredir=true | |
# Checking iPhone... | |
> 302 http://www.middletownjournal.com/?nmredir=true Set-Cookie: nmredir=true; | |
> 200 http://www.middletownjournal.com/?nmredir=true | |
http://middletownjournal.com/mobilesite?return=/ | |
# Checking Firefox... | |
> 302 http://m.middletownjournal.com/ Set-Cookie: nmredir=false; | |
> 200 http://m.middletownjournal.com/ | |
# Checking iPhone... | |
> 302 http://m.middletownjournal.com/ Set-Cookie: nmredir=false; | |
> 200 http://m.middletownjournal.com/ | |
http://oxfordpress.com/mobilesite?return=/ | |
# Checking Firefox... | |
> 302 http://m.oxfordpress.com/ Set-Cookie: nmredir=false; | |
> 200 http://m.oxfordpress.com/ | |
# Checking iPhone... | |
> 302 http://m.oxfordpress.com/ Set-Cookie: nmredir=false; | |
> 200 http://m.oxfordpress.com/ | |
http://oxfordpress.com/fullsite?return=/ | |
# Checking Firefox... | |
> 302 http://www.oxfordpress.com/?nmredir=true Set-Cookie: nmredir=true; | |
> 200 http://www.oxfordpress.com/?nmredir=true | |
# Checking iPhone... | |
> 302 http://www.oxfordpress.com/?nmredir=true Set-Cookie: nmredir=true; | |
> 200 http://www.oxfordpress.com/?nmredir=true | |
http://oxfordpress.com/mobilesite?return=/ | |
# Checking Firefox... | |
> 302 http://m.oxfordpress.com/ Set-Cookie: nmredir=false; | |
> 200 http://m.oxfordpress.com/ | |
# Checking iPhone... | |
> 302 http://m.oxfordpress.com/ Set-Cookie: nmredir=false; | |
> 200 http://m.oxfordpress.com/ | |
http://pulsejournal.com/mobilesite?return=/ | |
# Checking Firefox... | |
> 302 http://m.pulsejournal.com/ Set-Cookie: nmredir=false; | |
> 200 http://m.pulsejournal.com/ | |
# Checking iPhone... | |
> 302 http://m.pulsejournal.com/ Set-Cookie: nmredir=false; | |
> 200 http://m.pulsejournal.com/ | |
http://pulsejournal.com/fullsite?return=/ | |
# Checking Firefox... | |
> 302 http://www.pulsejournal.com/?nmredir=true Set-Cookie: nmredir=true; | |
> 200 http://www.pulsejournal.com/?nmredir=true | |
# Checking iPhone... | |
> 302 http://www.pulsejournal.com/?nmredir=true Set-Cookie: nmredir=true; | |
> 200 http://www.pulsejournal.com/?nmredir=true | |
http://pulsejournal.com/mobilesite?return=/ | |
# Checking Firefox... | |
> 302 http://m.pulsejournal.com/ Set-Cookie: nmredir=false; | |
> 200 http://m.pulsejournal.com/ | |
# Checking iPhone... | |
> 302 http://m.pulsejournal.com/ Set-Cookie: nmredir=false; | |
> 200 http://m.pulsejournal.com/ | |
http://springfieldnewssun.com/mobilesite?return=/ | |
# Checking Firefox... | |
> 302 http://m.springfieldnewssun.com/ Set-Cookie: nmredir=false; | |
> 200 http://m.springfieldnewssun.com/ | |
# Checking iPhone... | |
> 302 http://m.springfieldnewssun.com/ Set-Cookie: nmredir=false; | |
> 200 http://m.springfieldnewssun.com/ | |
http://springfieldnewssun.com/fullsite?return=/ | |
# Checking Firefox... | |
> 302 http://www.springfieldnewssun.com/?nmredir=true Set-Cookie: nmredir=true; | |
> 200 http://www.springfieldnewssun.com/?nmredir=true | |
# Checking iPhone... | |
> 302 http://www.springfieldnewssun.com/?nmredir=true Set-Cookie: nmredir=true; | |
> 200 http://www.springfieldnewssun.com/?nmredir=true | |
http://springfieldnewssun.com/mobilesite?return=/ | |
# Checking Firefox... | |
> 302 http://m.springfieldnewssun.com/ Set-Cookie: nmredir=false; | |
> 200 http://m.springfieldnewssun.com/ | |
# Checking iPhone... | |
> 302 http://m.springfieldnewssun.com/ Set-Cookie: nmredir=false; | |
> 200 http://m.springfieldnewssun.com/ | |
http://western-star.com/mobilesite?return=/ | |
# Checking Firefox... | |
> 302 http://m.western-star.com/ Set-Cookie: nmredir=false; | |
> 200 http://m.western-star.com/ | |
# Checking iPhone... | |
> 302 http://m.western-star.com/ Set-Cookie: nmredir=false; | |
> 200 http://m.western-star.com/ | |
http://western-star.com/fullsite?return=/ | |
# Checking Firefox... | |
> 302 http://www.western-star.com/?nmredir=true Set-Cookie: nmredir=true; | |
> 200 http://www.western-star.com/?nmredir=true | |
# Checking iPhone... | |
> 302 http://www.western-star.com/?nmredir=true Set-Cookie: nmredir=true; | |
> 200 http://www.western-star.com/?nmredir=true | |
http://western-star.com/mobilesite?return=/ | |
# Checking Firefox... | |
> 302 http://m.western-star.com/ Set-Cookie: nmredir=false; | |
> 200 http://m.western-star.com/ | |
# Checking iPhone... | |
> 302 http://m.western-star.com/ Set-Cookie: nmredir=false; | |
> 200 http://m.western-star.com/ | |
http://palmbeachpost.com/mobilesite?return=/ | |
# Checking Firefox... | |
> 302 http://m.palmbeachpost.com/ Set-Cookie: nmredir=false; | |
> 200 http://m.palmbeachpost.com/ | |
# Checking iPhone... | |
> 302 http://m.palmbeachpost.com/ Set-Cookie: nmredir=false; | |
> 200 http://m.palmbeachpost.com/ | |
http://palmbeachpost.com/fullsite?return=/ | |
# Checking Firefox... | |
> 302 http://www.palmbeachpost.com/?nmredir=true Set-Cookie: nmredir=true; | |
> 200 http://www.palmbeachpost.com/?nmredir=true | |
# Checking iPhone... | |
> 302 http://www.palmbeachpost.com/?nmredir=true Set-Cookie: nmredir=true; | |
> 200 http://www.palmbeachpost.com/?nmredir=true | |
http://palmbeachpost.com/mobilesite?return=/ | |
# Checking Firefox... | |
> 302 http://m.palmbeachpost.com/ Set-Cookie: nmredir=false; | |
> 200 http://m.palmbeachpost.com/ | |
# Checking iPhone... | |
> 302 http://m.palmbeachpost.com/ Set-Cookie: nmredir=false; | |
> 200 http://m.palmbeachpost.com/ | |
http://palmbeachdailynews.com/mobilesite?return=/ | |
# Checking Firefox... | |
> 302 http://m.palmbeachdailynews.com/ Set-Cookie: nmredir=false; | |
> 200 http://m.palmbeachdailynews.com/ | |
# Checking iPhone... | |
> 302 http://m.palmbeachdailynews.com/ Set-Cookie: nmredir=false; | |
> 200 http://m.palmbeachdailynews.com/ | |
http://palmbeachdailynews.com/fullsite?return=/ | |
# Checking Firefox... | |
> 302 http://www.palmbeachdailynews.com/?nmredir=true Set-Cookie: nmredir=true; | |
> 200 http://www.palmbeachdailynews.com/?nmredir=true | |
# Checking iPhone... | |
> 302 http://www.palmbeachdailynews.com/?nmredir=true Set-Cookie: nmredir=true; | |
> 200 http://www.palmbeachdailynews.com/?nmredir=true | |
http://palmbeachdailynews.com/mobilesite?return=/ | |
# Checking Firefox... | |
> 302 http://m.palmbeachdailynews.com/ Set-Cookie: nmredir=false; | |
> 200 http://m.palmbeachdailynews.com/ | |
# Checking iPhone... | |
> 302 http://m.palmbeachdailynews.com/ Set-Cookie: nmredir=false; | |
> 200 http://m.palmbeachdailynews.com/ | |
http://pbpulse.com/mobilesite?return=/ | |
# Checking Firefox... | |
> 302 http://m.pbpulse.com/ Set-Cookie: nmredir=false; | |
> 200 http://m.pbpulse.com/ | |
# Checking iPhone... | |
> 302 http://m.pbpulse.com/ Set-Cookie: nmredir=false; | |
> 200 http://m.pbpulse.com/ | |
http://pbpulse.com/fullsite?return=/ | |
# Checking Firefox... | |
> 302 http://www.pbpulse.com/?nmredir=true Set-Cookie: nmredir=true; | |
> 200 http://www.pbpulse.com/?nmredir=true | |
# Checking iPhone... | |
> 302 http://www.pbpulse.com/?nmredir=true Set-Cookie: nmredir=true; | |
> 200 http://www.pbpulse.com/?nmredir=true | |
http://pbpulse.com/mobilesite?return=/ | |
# Checking Firefox... | |
> 302 http://m.pbpulse.com/ Set-Cookie: nmredir=false; | |
> 200 http://m.pbpulse.com/ | |
# Checking iPhone... | |
> 302 http://m.pbpulse.com/ Set-Cookie: nmredir=false; | |
> 200 http://m.pbpulse.com/ | |
#### test weather redirects #### | |
http://m.ajc.com/weather | |
# Checking Firefox... | |
> 301 http://m.ajc.com/weather/ | |
> 200 http://m.ajc.com/weather/ | |
# Checking iPhone... | |
> 301 http://m.ajc.com/weather/ | |
> 200 http://m.ajc.com/weather/ | |
http://m.ajc.com/weather/30301/today/ | |
# Checking Firefox... | |
> 200 http://m.ajc.com/weather/30301/today/ | |
# Checking iPhone... | |
> 200 http://m.ajc.com/weather/30301/today/ | |
http://m.accessatlanta.com/weather | |
# Checking Firefox... | |
> 301 http://m.accessatlanta.com/weather/ | |
> 200 http://m.accessatlanta.com/weather/ | |
# Checking iPhone... | |
> 301 http://m.accessatlanta.com/weather/ | |
> 200 http://m.accessatlanta.com/weather/ | |
http://m.accessatlanta.com/weather/30301/today/ | |
# Checking Firefox... | |
> 200 http://m.accessatlanta.com/weather/30301/today/ | |
# Checking iPhone... | |
> 200 http://m.accessatlanta.com/weather/30301/today/ | |
http://m.daytondailynews.com/weather | |
# Checking Firefox... | |
> 301 http://m.daytondailynews.com/weather/ | |
> 200 http://m.daytondailynews.com/weather/ | |
# Checking iPhone... | |
> 301 http://m.daytondailynews.com/weather/ | |
> 200 http://m.daytondailynews.com/weather/ | |
http://m.daytondailynews.com/weather/30301/today/ | |
# Checking Firefox... | |
> 200 http://m.daytondailynews.com/weather/30301/today/ | |
# Checking iPhone... | |
> 200 http://m.daytondailynews.com/weather/30301/today/ | |
http://m.activedayton.com/weather | |
# Checking Firefox... | |
> 301 http://m.activedayton.com/weather/ | |
> 200 http://m.activedayton.com/weather/ | |
# Checking iPhone... | |
> 301 http://m.activedayton.com/weather/ | |
> 200 http://m.activedayton.com/weather/ | |
http://m.activedayton.com/weather/30301/today/ | |
# Checking Firefox... | |
> 200 http://m.activedayton.com/weather/30301/today/ | |
# Checking iPhone... | |
> 200 http://m.activedayton.com/weather/30301/today/ | |
http://m.journal-news.com/weather | |
# Checking Firefox... | |
> 301 http://m.journal-news.com/weather/ | |
> 200 http://m.journal-news.com/weather/ | |
# Checking iPhone... | |
> 301 http://m.journal-news.com/weather/ | |
> 200 http://m.journal-news.com/weather/ | |
http://m.journal-news.com/weather/30301/today/ | |
# Checking Firefox... | |
> 200 http://m.journal-news.com/weather/30301/today/ | |
# Checking iPhone... | |
> 200 http://m.journal-news.com/weather/30301/today/ | |
http://m.middletownjournal.com/weather | |
# Checking Firefox... | |
> 301 http://m.middletownjournal.com/weather/ | |
> 200 http://m.middletownjournal.com/weather/ | |
# Checking iPhone... | |
> 301 http://m.middletownjournal.com/weather/ | |
> 200 http://m.middletownjournal.com/weather/ | |
http://m.middletownjournal.com/weather/30301/today/ | |
# Checking Firefox... | |
> 200 http://m.middletownjournal.com/weather/30301/today/ | |
# Checking iPhone... | |
> 200 http://m.middletownjournal.com/weather/30301/today/ | |
http://m.oxfordpress.com/weather | |
# Checking Firefox... | |
> 301 http://m.oxfordpress.com/weather/ | |
> 200 http://m.oxfordpress.com/weather/ | |
# Checking iPhone... | |
> 301 http://m.oxfordpress.com/weather/ | |
> 200 http://m.oxfordpress.com/weather/ | |
http://m.oxfordpress.com/weather/30301/today/ | |
# Checking Firefox... | |
> 200 http://m.oxfordpress.com/weather/30301/today/ | |
# Checking iPhone... | |
> 200 http://m.oxfordpress.com/weather/30301/today/ | |
http://m.pulsejournal.com/weather | |
# Checking Firefox... | |
> 301 http://m.pulsejournal.com/weather/ | |
> 200 http://m.pulsejournal.com/weather/ | |
# Checking iPhone... | |
> 301 http://m.pulsejournal.com/weather/ | |
> 200 http://m.pulsejournal.com/weather/ | |
http://m.pulsejournal.com/weather/30301/today/ | |
# Checking Firefox... | |
> 200 http://m.pulsejournal.com/weather/30301/today/ | |
# Checking iPhone... | |
> 200 http://m.pulsejournal.com/weather/30301/today/ | |
http://m.springfieldnewssun.com/weather | |
# Checking Firefox... | |
> 301 http://m.springfieldnewssun.com/weather/ | |
> 200 http://m.springfieldnewssun.com/weather/ | |
# Checking iPhone... | |
> 301 http://m.springfieldnewssun.com/weather/ | |
> 200 http://m.springfieldnewssun.com/weather/ | |
http://m.springfieldnewssun.com/weather/30301/today/ | |
# Checking Firefox... | |
> 200 http://m.springfieldnewssun.com/weather/30301/today/ | |
# Checking iPhone... | |
> 200 http://m.springfieldnewssun.com/weather/30301/today/ | |
http://m.western-star.com/weather | |
# Checking Firefox... | |
> 301 http://m.western-star.com/weather/ | |
> 200 http://m.western-star.com/weather/ | |
# Checking iPhone... | |
> 301 http://m.western-star.com/weather/ | |
> 200 http://m.western-star.com/weather/ | |
http://m.western-star.com/weather/30301/today/ | |
# Checking Firefox... | |
> 200 http://m.western-star.com/weather/30301/today/ | |
# Checking iPhone... | |
> 200 http://m.western-star.com/weather/30301/today/ | |
http://m.palmbeachpost.com/weather | |
# Checking Firefox... | |
> 301 http://m.palmbeachpost.com/weather/ | |
> 200 http://m.palmbeachpost.com/weather/ | |
# Checking iPhone... | |
> 301 http://m.palmbeachpost.com/weather/ | |
> 200 http://m.palmbeachpost.com/weather/ | |
http://m.palmbeachpost.com/weather/33401/ | |
# Checking Firefox... | |
> 200 http://m.palmbeachpost.com/weather/33401/ | |
# Checking iPhone... | |
> 200 http://m.palmbeachpost.com/weather/33401/ | |
http://m.palmbeachpost.com/weather/33401/today/ | |
# Checking Firefox... | |
> 200 http://m.palmbeachpost.com/weather/33401/today/ | |
# Checking iPhone... | |
> 200 http://m.palmbeachpost.com/weather/33401/today/ | |
http://m.palmbeachpost.com/weather/33401/hour-by-hour/ | |
# Checking Firefox... | |
> 200 http://m.palmbeachpost.com/weather/33401/hour-by-hour/ | |
# Checking iPhone... | |
> 200 http://m.palmbeachpost.com/weather/33401/hour-by-hour/ | |
http://m.palmbeachpost.com/weather/33401/five-day/ | |
# Checking Firefox... | |
> 200 http://m.palmbeachpost.com/weather/33401/five-day/ | |
# Checking iPhone... | |
> 200 http://m.palmbeachpost.com/weather/33401/five-day/ | |
http://m.palmbeachdailynews.com/weather | |
# Checking Firefox... | |
> 301 http://m.palmbeachdailynews.com/weather/ | |
> 200 http://m.palmbeachdailynews.com/weather/ | |
# Checking iPhone... | |
> 301 http://m.palmbeachdailynews.com/weather/ | |
> 200 http://m.palmbeachdailynews.com/weather/ | |
http://m.palmbeachdailynews.com/weather/30301/today/ | |
# Checking Firefox... | |
> 200 http://m.palmbeachdailynews.com/weather/30301/today/ | |
# Checking iPhone... | |
> 200 http://m.palmbeachdailynews.com/weather/30301/today/ | |
http://m.pbpulse.com/weather | |
# Checking Firefox... | |
> 301 http://m.pbpulse.com/weather/ | |
> 200 http://m.pbpulse.com/weather/ | |
# Checking iPhone... | |
> 301 http://m.pbpulse.com/weather/ | |
> 200 http://m.pbpulse.com/weather/ | |
http://m.pbpulse.com/weather/30301/today/ | |
# Checking Firefox... | |
> 200 http://m.pbpulse.com/weather/30301/today/ | |
# Checking iPhone... | |
> 200 http://m.pbpulse.com/weather/30301/today/ | |
#### test story redirects #### | |
http://www.ajc.com/ap/ap/top-news/sandy-leaves-death-damp-and-darkness-in-wake/nSrWm/ | |
# Checking Firefox... | |
> 200 http://www.ajc.com/ap/ap/top-news/sandy-leaves-death-damp-and-darkness-in-wake/nSrWm/ | |
# Checking iPhone... | |
> 302 http://m.ajc.com/ap/ap/top-news/sandy-leaves-death-damp-and-darkness-in-wake/nSrWm/ | |
> 200 http://m.ajc.com/ap/ap/top-news/sandy-leaves-death-damp-and-darkness-in-wake/nSrWm/ | |
http://www.accessatlanta.com/ap/ap/entertainment/from-springsteen-to-letterman-sandy-disrupts/nSrm9/ | |
# Checking Firefox... | |
> 200 http://www.accessatlanta.com/ap/ap/entertainment/from-springsteen-to-letterman-sandy-disrupts/nSrm9/ | |
# Checking iPhone... | |
> 302 http://m.accessatlanta.com/ap/ap/entertainment/from-springsteen-to-letterman-sandy-disrupts/nSrm9/ | |
> 200 http://m.accessatlanta.com/ap/ap/entertainment/from-springsteen-to-letterman-sandy-disrupts/nSrm9/ | |
http://www.daytondailynews.com/ap/ap/top-news/sandy-leaves-death-damp-and-darkness-in-wake/nSrWm/ | |
# Checking Firefox... | |
> 200 http://www.daytondailynews.com/ap/ap/top-news/sandy-leaves-death-damp-and-darkness-in-wake/nSrWm/ | |
# Checking iPhone... | |
> 302 http://m.daytondailynews.com/ap/ap/top-news/sandy-leaves-death-damp-and-darkness-in-wake/nSrWm/ | |
> 200 http://m.daytondailynews.com/ap/ap/top-news/sandy-leaves-death-damp-and-darkness-in-wake/nSrWm/ | |
http://www.activedayton.com/news/news/area-trick-or-treat-events-canceled-due-to-weather/nSrbY/ | |
# Checking Firefox... | |
> 200 http://www.activedayton.com/news/news/area-trick-or-treat-events-canceled-due-to-weather/nSrbY/ | |
# Checking iPhone... | |
> 302 http://m.activedayton.com/news/news/area-trick-or-treat-events-canceled-due-to-weather/nSrbY/ | |
> 200 http://m.activedayton.com/news/news/area-trick-or-treat-events-canceled-due-to-weather/nSrbY/ | |
http://www.journal-news.com/ap/ap/top-news/sandy-leaves-death-damp-and-darkness-in-wake/nSrWm/ | |
# Checking Firefox... | |
> 200 http://www.journal-news.com/ap/ap/top-news/sandy-leaves-death-damp-and-darkness-in-wake/nSrWm/ | |
# Checking iPhone... | |
> 302 http://m.journal-news.com/ap/ap/top-news/sandy-leaves-death-damp-and-darkness-in-wake/nSrWm/ | |
> 200 http://m.journal-news.com/ap/ap/top-news/sandy-leaves-death-damp-and-darkness-in-wake/nSrWm/ | |
http://www.middletownjournal.com/ap/ap/top-news/sandy-leaves-death-damp-and-darkness-in-wake/nSrWm/ | |
# Checking Firefox... | |
> 200 http://www.middletownjournal.com/ap/ap/top-news/sandy-leaves-death-damp-and-darkness-in-wake/nSrWm/ | |
# Checking iPhone... | |
> 302 http://m.middletownjournal.com/ap/ap/top-news/sandy-leaves-death-damp-and-darkness-in-wake/nSrWm/ | |
> 200 http://m.middletownjournal.com/ap/ap/top-news/sandy-leaves-death-damp-and-darkness-in-wake/nSrWm/ | |
http://www.oxfordpress.com/news/ap/energy/superstorm-sandy-takes-aim-at-atlantic-coast/nSrCR/ | |
# Checking Firefox... | |
> 200 http://www.oxfordpress.com/news/ap/energy/superstorm-sandy-takes-aim-at-atlantic-coast/nSrCR/ | |
# Checking iPhone... | |
> 302 http://m.oxfordpress.com/news/ap/energy/superstorm-sandy-takes-aim-at-atlantic-coast/nSrCR/ | |
> 200 http://m.oxfordpress.com/news/ap/energy/superstorm-sandy-takes-aim-at-atlantic-coast/nSrCR/ | |
http://www.pulsejournal.com/news/ap/energy/superstorm-sandy-takes-aim-at-atlantic-coast/nSrCR/ | |
# Checking Firefox... | |
> 200 http://www.pulsejournal.com/news/ap/energy/superstorm-sandy-takes-aim-at-atlantic-coast/nSrCR/ | |
# Checking iPhone... | |
> 302 http://m.pulsejournal.com/news/ap/energy/superstorm-sandy-takes-aim-at-atlantic-coast/nSrCR/ | |
> 200 http://m.pulsejournal.com/news/ap/energy/superstorm-sandy-takes-aim-at-atlantic-coast/nSrCR/ | |
http://www.springfieldnewssun.com/ap/ap/top-news/sandy-leaves-death-damp-and-darkness-in-wake/nSrWm/ | |
# Checking Firefox... | |
> 200 http://www.springfieldnewssun.com/ap/ap/top-news/sandy-leaves-death-damp-and-darkness-in-wake/nSrWm/ | |
# Checking iPhone... | |
> 302 http://m.springfieldnewssun.com/ap/ap/top-news/sandy-leaves-death-damp-and-darkness-in-wake/nSrWm/ | |
> 200 http://m.springfieldnewssun.com/ap/ap/top-news/sandy-leaves-death-damp-and-darkness-in-wake/nSrWm/ | |
http://www.western-star.com/news/ap/energy/superstorm-sandy-takes-aim-at-atlantic-coast/nSrCR/ | |
# Checking Firefox... | |
> 200 http://www.western-star.com/news/ap/energy/superstorm-sandy-takes-aim-at-atlantic-coast/nSrCR/ | |
# Checking iPhone... | |
> 302 http://m.western-star.com/news/ap/energy/superstorm-sandy-takes-aim-at-atlantic-coast/nSrCR/ | |
> 200 http://m.western-star.com/news/ap/energy/superstorm-sandy-takes-aim-at-atlantic-coast/nSrCR/ | |
http://www.palmbeachpost.com/ap/ap/top-news/sandy-leaves-death-damp-and-darkness-in-wake/nSrWm/ | |
# Checking Firefox... | |
> 200 http://www.palmbeachpost.com/ap/ap/top-news/sandy-leaves-death-damp-and-darkness-in-wake/nSrWm/ | |
# Checking iPhone... | |
> 302 http://m.palmbeachpost.com/ap/ap/top-news/sandy-leaves-death-damp-and-darkness-in-wake/nSrWm/ | |
> 200 http://m.palmbeachpost.com/ap/ap/top-news/sandy-leaves-death-damp-and-darkness-in-wake/nSrWm/ | |
http://www.palmbeachdailynews.com/news/news/world/expect-tropical-force-winds-erosion-in-pb/nSn2G/ | |
# Checking Firefox... | |
> 200 http://www.palmbeachdailynews.com/news/news/world/expect-tropical-force-winds-erosion-in-pb/nSn2G/ | |
# Checking iPhone... | |
> 302 http://m.palmbeachdailynews.com/news/news/world/expect-tropical-force-winds-erosion-in-pb/nSn2G/ | |
> 200 http://m.palmbeachdailynews.com/news/news/world/expect-tropical-force-winds-erosion-in-pb/nSn2G/ | |
http://www.pbpulse.com/ap/ap/entertainment/from-springsteen-to-letterman-sandy-disrupts/nSrnT/ | |
# Checking Firefox... | |
> 200 http://www.pbpulse.com/ap/ap/entertainment/from-springsteen-to-letterman-sandy-disrupts/nSrnT/ | |
# Checking iPhone... | |
> 302 http://m.pbpulse.com/ap/ap/entertainment/from-springsteen-to-letterman-sandy-disrupts/nSrnT/ | |
> 200 http://m.pbpulse.com/ap/ap/entertainment/from-springsteen-to-letterman-sandy-disrupts/nSrnT/ | |
#### test wap-dot redirects #### | |
http://wap.ajc.com/ | |
# Checking Firefox... | |
> 302 http://m.ajc.com/ | |
> 200 http://m.ajc.com/ | |
# Checking iPhone... | |
> 302 http://m.ajc.com/ | |
> 200 http://m.ajc.com/ | |
http://wap.palmbeachpost.com/ | |
# Checking Firefox... | |
> 301 http://m.palmbeachpost.com/ | |
> 200 http://m.palmbeachpost.com/ | |
# Checking iPhone... | |
> 301 http://m.palmbeachpost.com/ | |
> 200 http://m.palmbeachpost.com/ | |
http://wap.pbpulse.com/ | |
# Checking Firefox... | |
> 301 http://m.pbpulse.com/ | |
> 200 http://m.pbpulse.com/ | |
# Checking iPhone... | |
> 301 http://m.pbpulse.com/ | |
> 200 http://m.pbpulse.com/ | |
http://wap.pbpost.com/ | |
# Checking Firefox... | |
> 301 http://m.palmbeachpost.com/ | |
> 200 http://m.palmbeachpost.com/ | |
# Checking iPhone... | |
> 301 http://m.palmbeachpost.com/ | |
> 200 http://m.palmbeachpost.com/ | |
This file contains hidden or 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
#!/usr/bin/env bash | |
# ATTENTION: Please do not think badly of me for this code! | |
# I REALLY WANT TO REDO THIS IN PYTHON AND USE YAML!!! | |
# It started out as a oneliner! https://gist.github.com/1158733/2f9aa7e2db9ccfbda4669c2102daebacf8a04284#L6 | |
# In the interest of easy of use, I highly suggest defining and using this function at your shell | |
# urltest() { for url in $@; do ./urltest $url; done } | |
# Use that function like so... | |
# urltest http://example.com http://google.com | |
check(){ | |
curl -sL -m 30 -o /dev/null -D /dev/stdout -b /tmp/cookies.$1.txt -c /tmp/cookies.$1.txt -A $* | \ | |
# remove dos line endings | |
tr -d '\r' | \ | |
# simplify the output | |
awk -v url="${@: -1}" ' | |
tolower($1) ~ /^http\// { | |
status=$2 | |
}; | |
tolower($1) ~ /^location/ { | |
url=$2 | |
}; | |
tolower($1) ~ /^set-cookie/ { | |
cookie=$2 | |
}; | |
/^$/{ | |
#print "########################################"; | |
if(match(cookie,"nmredir")){ | |
output=" Set-Cookie: " cookie; | |
}else{ | |
output="" | |
}; | |
#print "status: " status; | |
#print "url: " url; | |
#print "output: " output; | |
print " > " status " " url " " output; | |
#status="" | |
cookie="" | |
}; | |
' | |
} | |
docheck(){ | |
url="${@}" | |
echo $url; | |
for agent in Firefox iPhone; do | |
echo " # Checking $agent..."; | |
check $agent $url | |
done | |
echo; | |
} | |
docheck "${@}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment