Created
December 3, 2015 15:53
-
-
Save jobicoppola/798a2f97a163488fd9c0 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
#!/usr/bin/env bash | |
[ -z "$1" ] && read -p "sn or sportal? " site || site="$1" | |
sections=( league afl football rugby cricket horse-racing ) | |
test_urls=() | |
test_urls+=('article/news/mclaren-to-announce-line-up-next-month/1k5r8c7lt6h8i12s9m0sjex9je') | |
test_urls+=('football/news/video-zinedine-zidanes-son-luca-sent-off-for-headbutt/h8gqy71f0dm8135xmfq73gu1a') | |
test_urls+=('rugby/rugby-union/maa-nonu-jonah-lomu-all-blacks-new-zealand-rugby-union/1e4mfbbbufcde1nhv3soowij0f') | |
test_urls+=('article/news/mclaren-to-announce-line-up-next-month') | |
test_urls+=('football/news/video-zinedine-zidanes-son-luca-sent-off-for-headbutt') | |
test_urls+=('rugby/rugby-union/maa-nonu-jonah-lomu-all-blacks-new-zealand-rugby-union') | |
#base_url_test=http://web017.sn.internal | |
sn_base_url=http://www.sportingnews.com | |
sportal_base_url=http://www.sportal.com.au | |
test_sections(){ | |
for section in ${sections[@]}; do | |
local url=${base_url_test}/${section} | |
echo -e "\n\n===> $url" | |
curl -SiIL -H "Host: www.sportal.com.au" ${url} | |
done | |
} | |
test_sportal_urls(){ | |
for test_url in ${test_urls[@]}; do | |
local url=${sportal_base_url}/${test_url} | |
local pragma | |
pragma="Pragma: akamai-x-get-client-ip, akamai-x-cache-on, " | |
pragma+="akamai-x-cache-remote-on, akamai-x-check-cacheable, " | |
pragma+="akamai-x-get-cache-key, akamai-x-get-nonces, " | |
pragma+="akamai-x-get-ssl-client-session-id, " | |
pragma+="akamai-x-get-true-cache-key, akamai-x-serial-no, " | |
pragma+="akamai-x-get-request-id" \ | |
echo -e "\n\n===> $url" | |
curl -H "$pragma" -sSiL $url \ | |
|egrep '<title>|^HTTP|X-Cache|X-True-Cache|X-Akamai-Pragma|X-Localization' | |
done | |
} | |
[[ "$site" == sportal ]] && test_sportal_urls || test_sections |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment