Re: Cookies & URL Access Scripting
Re: Cookies & URL Access Scripting
- Subject: Re: Cookies & URL Access Scripting
- From: Matthew Stuckwisch <email@hidden>
- Date: Thu, 2 May 2002 19:54:49 -0500
Is there anyway to include the passing of a cookie using the URL Access
Scripting mechanism?
If not, is there any other scripting addition I can use to accomplish
this?
Hmmm...with URL Access....I dunno, either way, don't use it, it's poo ^_-
Pretty darned sure cookies can be passed along with curl *checks man curl*
Yes, cookies can be done with curl.
[localhost:~] guifa% man curl
...
SYNOPSIS
curl [options] [URL...]
DESCRIPTION
...
curl offers a busload of useful tricks like proxy support,
user authentication, ftp upload, HTTP post, SSL (https:)
connections, cookies, file transfer resume and more.
...
OPTIONS
...
-b/--cookie <name=data>
(HTTP) Pass the data to the HTTP server as a
cookie. It is supposedly the data previously
received from the server in a "Set-Cookie:" line.
The data should be in the format "NAME1=VALUE1;
NAME2=VALUE2".
If no '=' letter is used in the line, it is treated
as a filename to use to read previously stored
cookie lines from, which should be used in this
session if they match. Using this method also acti-
vates the "cookie parser" which will make curl
record incoming cookies too, which may be handy if
you're using this in combination with the
-L/--location option. The file format of the file
to read cookies from should be plain HTTP headers
or the netscape cookie file format.
...
-------
Basically, from what I can tell (I don't know much about cookies), your
code is going to look like this in your script:
set theCookieData to "\"" & name1 & "=" & value1 & "; " & name2 & "=" &
value2 & "; " & "\""
set theURL to yourURL
set thePage to (do shell script script "curl -b " & theCookeData & " " &
theURL)
That should work, /me thinks
Matthew Stuckwisch
[AIM/MSN]{GuifaSwimmer} | [Yahoo!]{SapphireTree} | [ICQ]{137477701}
[IRC]{guifa / G}(esperNET / irc.massinova.com)
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.