Package: w3m
Version: 0.5.2-2.1
Severity: wishlist
Summary: please make w3m use the same cookie file format as wget, curl
and (apparently) netscape/mozilla/firefox.
Both curl and wget can read and write cookie files in "the
Netscape/Mozilla cookie file format". This means that I can automate
logins to stupid web apps:
curl --cookie-jar j -so/dev/null \
http://example.net/login.php \
-F username=$USER -F password=<-
And then both wget and curl can use that logged-in cookie:
curl --cookie j http://example.net/stupid.php
wget --load-cookies j http://example.net/stupid.php
I want to similar automate login for interactive web apps:
curl --cookie-jar ~/.w3m/cookie example.net/login ...
w3m example.net/main
But unfortunately w3m uses a different cookie format! By reading
w3m's source code, I had to make a guess as to how to translate
cookies into w3m's (undocumented?) format:
<cookie-jar egrep -v '^($|#)' |
while read domain bool1 path bool2 int1 name value
do url=http://$domain/some-application-specific-string
expires=$(date -dtomorrow +%s)
portlist='' flag=13 version=0
# If the domain is not an FQDN, but instead a host in the
# default DNS search domain, apparently w3m and curl behave
# differently in some way I don't understand.
if ! [[ $domain =~ \. ]]
then domain=some-hard-coded-string
fi
printf '%s\t' "$url" "$name" "$value" "$expires" "$domain" "$path"
"$flag" "$version" "$portlist"
echo
done >>~/.w3m/cookie
Such a translation script is incomplete and prone to failure.
It would be much easier for me if w3m simply used the same cookie file
format as wget and curl! Apparently this file format is also the one
used by Mozilla browsers, so I guess it is a pretty widespread
convention.
Of course, this would also make it easier to go the other way -- for
me to log in to a stupid web app via w3m, and then use wget or curl to
download a file that requires the stupid logged-in cookie:
wget --load-cookies ~/.w3m/cookie http://example.net/foo.pdf
-- System Information:
Debian Release: squeeze/sid
APT prefers testing
APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.30-1-686 (SMP w/1 CPU core)
Locale: LANG=en_AU.utf8, LC_CTYPE=en_AU.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages w3m depends on:
ii libc6 2.9-12 GNU C Library: Shared libraries
ii libgc1c2 1:6.8-1.2 conservative garbage collector for
ii libgpm2 1.20.4-3.2 General Purpose Mouse - shared lib
ii libncurses5 5.7+20090523-1 shared libraries for terminal hand
ii libssl0.9.8 0.9.8k-3 SSL shared libraries
ii zlib1g 1:1.2.3.3.dfsg-13 compression library - runtime
Versions of packages w3m recommends:
ii ca-certificates 20090709 Common CA certificates
Versions of packages w3m suggests:
ii man-db 2.5.5-3 on-line manual pager
pn menu <none> (no description available)
pn migemo <none> (no description available)
ii mime-support 3.46-1 MIME files 'mime.types' & 'mailcap
ii w3m-el-snapshot [w3 1.4.364+0.20090802-1 simple Emacs interface of w3m (dev
ii w3m-img 0.5.2-2.1 inline image extension support uti
-- no debconf information
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]