Skip to content

Instantly share code, notes, and snippets.

@RichardBronosky
Created October 27, 2010 15:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RichardBronosky/649196 to your computer and use it in GitHub Desktop.
Save RichardBronosky/649196 to your computer and use it in GitHub Desktop.
hammers a url with various user agents
url=http://test.www.clarkhoward.com/
agents=(
'Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_1_3 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7E18 Safari/528.16'
'Mozilla/5.0 (iPhone Simulator; U; CPU iPhone OS 3_0 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7A341 Safari/528.16'
'BlackBerry9700/5.0.0.602 Profile/MIDP-2.1 Configuration/CLDC-1.1 VendorID/102'
)
trap "exit" INT # Ctrl-C should exit the script, not simply break the for/while loop
while true; do
(
echo;
date;
for agent in "${agents[@]}"; do
echo "curl -s -I -A '$agent' $url";
curl -s -I -A "$agent" $url | tr -d '\r';
done;
sleep 1;
) | tee -a /tmp/mobile_access.log | grep '^L';
done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment