Skip to content

Instantly share code, notes, and snippets.

@paslandau
Created June 30, 2017 15:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save paslandau/7aef68dd71c7e2b78389dcb743ae6172 to your computer and use it in GitHub Desktop.
Save paslandau/7aef68dd71c7e2b78389dcb743ae6172 to your computer and use it in GitHub Desktop.
Bash script to check geo- and mobile redirects for aboutyou de/at/ch when using Googlebot user agents
y="at
ch
de"; \
x="
Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.96 Mobile Safari/537.36 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)
Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)
Googlebot/2.1 (+http://www.google.com/bot.html)
"; \
IFS="\n"; readarray -t countries <<<"$y";\
readarray -t userAgents <<<"$x"; IFS=""; \ for y in ${userAgents[@]}; do for x in ${countries[@]}; do url="https://www.aboutyou.${x}/"; printf "\n$url with $y\n"; curl -sIL -H "user-agent: $y" $url 2>&1 | egrep 'HTTP/1.1|Location|Failed'; done; done;
@nic0711
Copy link

nic0711 commented Jul 25, 2017

Hi Pascal,

nettes script. ;)

VG
Wolf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment