Created
June 17, 2021 17:17
-
-
Save jleclanche/892d1adc40ff9bc7d4deb4f7138683d2 to your computer and use it in GitHub Desktop.
Blizzard patchnotes script (OLD, NO LONGER WORKS)
This file contains hidden or 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
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