HTTrack Website Copier
Free software offline browser - FORUM
Subject: Re: Handle unique login token
Author: Amadeus
Date: 07/17/2012 16:23
 
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

 
Reply Create subthread


All articles

Subject Author Date
Handle unique login token

06/20/2012 14:51
Re: Handle unique login token

06/20/2012 15:22
Re: Handle unique login token

06/20/2012 15:47
Re: Handle unique login token

07/17/2012 16:23




3

Created with FORUM 2.0.11