Skip to content

Instantly share code, notes, and snippets.

@jleclanche
Created March 13, 2014 18:13
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/9533710 to your computer and use it in GitHub Desktop.
Save jleclanche/9533710 to your computer and use it in GitHub Desktop.
Get plaintext patchnotes from the command line
function patchnotes {
ua="Battle.net/1.0.8.4217"
_baseurl="https://us.battle.net/connect/en/app"
usage="usage: $0 <product> [live|ptr|beta]\nproduct is one of wow, s2, d3, wtcg"
hash lynx 2>/dev/null || {
echo "You need to install Lynx first."
return 1
}
if [[ $1 == ("--help"|"-h") ]]; then
echo $usage
return 0
fi
if [[ $# == 0 || $1 != ("wow"|"s2"|"d3"|"wtcg") ]]; then
echo $usage
return 1
fi
if [[ $# == 1 ]]; then
product="live"
else
product=$2
fi
lynx -dump -useragent=$ua "$_baseurl/$1/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