0

How I can load page with POST parameters, save response cookies, save cookies, and load another page with saved cookies in emacs lisp?

In other words, I need analog to this bash code:

#!/bin/sh

LOGIN=SOMELOGIN
PASSWORD=SOMEPASSWORD

# Save cookie
curl -d "login=$LOGIN&password=$PASSWORD" -c /tmp/some.cookie http://stat.somesite.ru/

# Load page
curl -s -b /tmp/some.cookie http://stat.somesite.ru/ > /tmp/some.page

# Manipulations with saved page....

If any manuals, code sources, etc exists -- let me know :)

Drakmail
  • 682
  • 2
  • 7
  • 22

1 Answers1

1

It should be possible to execute those commands with the shell-command function and/or its derivatives (q.v., Running Shell Commands from Emacs).

Greg E.
  • 2,722
  • 1
  • 16
  • 22
  • Yes, I know, but I want clean elisp solution. – Drakmail Jun 03 '12 at 12:34
  • 1
    In that case, you could look into using `w3m` or the `URL` packages, the latter of which I believe is now part of the standard distribution. Unfortunately, I don't have much experience using either, but I suspect that availing yourself of the relevant pages on the [Emacs Wiki](http://emacswiki.org/) would be useful. – Greg E. Jun 03 '12 at 12:45
  • Yep, I'm tryed use url.el, but it almost hasn't any documentation ( only http://emacswiki.org/emacs/UrlPackage ) about work with cookies. – Drakmail Jun 03 '12 at 13:10