| MW_LOGIN=""
MW_PASSWD=""
MW_DOMAIN=""
MW_URL=""
MW_PAGE=""
# Mediawiki uses a login token, and we must have it for this to work.
WP_LOGIN_TOKEN=$(wget -q --no-check-certificate -O - --save-cookies
cookies.txt --keep-session-cookies "$MW_URL/index.php/Special:UserLogin" |
grep wpLoginToken | grep -o '[a-z0-9]\{32\}')
wget -q --no-check-certificate --load-cookies cookies.txt --save-cookies
cookies.txt --keep-session-cookies --post-data
"wpName=${MW_LOGIN}&wpPassword=${MW_PASSWD}&wpDomain=${MW_DOMAIN}&wpRemember=1&wpLoginattempt=Log%20in&wpLoginToken=${WP_LOGIN_TOKEN}"
"$MW_URL/index.php?title=Special:UserLogin&action=submitlogin&type=login" -O
tmp
wget -q --no-check-certificate --load-cookies cookies.txt
--keep-session-cookies "$MW_URL/index.php/${MW_PAGE}" -O tmp.html
| |