Created
November 19, 2015 21:25
-
-
Save ryaan-anthony/381c26ac40e5aafc0cfa 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 | |
if [ -z $1 ] | |
then | |
echo 'Sitemap must be provided as first argument.';exit 2 | |
fi | |
# Helper function to read xml | |
read_dom () { | |
local IFS=\> | |
read -d \< ENTITY CONTENT | |
} | |
mkdir tmp | |
cd tmp | |
wget $1 | |
cd ../ | |
while read_dom; do | |
if [[ $ENTITY = "loc" ]]; then | |
echo $CONTENT | |
fi | |
done < tmp/sitemap.xml > sitemap.txt | |
rm -rf tmp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Run this:
./xmltotxt.sh http://domain.com/path/to/sitemap.xml
Now you can siege all the urls:
siege -c50 -d10 -i -f sitemap.txt