Search code examples
httpcookiesemacselispemacs23

Load page, save cookies and load another page with cookies


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 :)


Solution

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