Skip to content

Instantly share code, notes, and snippets.

@jleclanche
Created June 17, 2021 17:17
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 jleclanche/892d1adc40ff9bc7d4deb4f7138683d2 to your computer and use it in GitHub Desktop.
Save jleclanche/892d1adc40ff9bc7d4deb4f7138683d2 to your computer and use it in GitHub Desktop.
Blizzard patchnotes script (OLD, NO LONGER WORKS)
function patchnotes {
ua="Battle.net/1.0.8.4217"
_baseurl="https://us.battle.net/connect/"
usage="usage: $0 <product> [live|ptr|beta] [language]\nproduct is one of wow, s2, d3, heroes, wtcg"
hash lynx 2>/dev/null || {
>&2 echo "You need to install Lynx first."
return 1
}
if [[ $1 == ("--help"|"-h") ]]; then
>&2 echo "$usage"
return 0
fi
prog="$1"
if [[ $# == 1 ]]; then
product="live"
lang="en"
elif [[ $# == 2 ]]; then
product="$2"
lang="en"
elif [[ $# == 3 ]]; then
product="$2"
lang="$3"
else
>&2 echo "$usage"
return 1
fi
lynx -dump -display_charset="UTF-8" -useragent="$ua" "$_baseurl/$lang/app/$prog/patch-notes?productType=$product" 2> /dev/null
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment