• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
URL Access Scripting- post data
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

URL Access Scripting- post data


  • Subject: URL Access Scripting- post data
  • From: email@hidden (Gerd)
  • Date: Wed, 16 Oct 2002 19:22:32 +0200

Hallo Daniel,

thanks for your mail. Now i know why it always tried to open the OS 9 version. I hope i will buy Jaguar next month.
I will try your sample next days.

But for download i think i must buy Webminer, as download with UAS was taking me five or six hours and with Webminer it took less then one hour and i could get all without the html characters., what is not possible with UAS.

Gerd


Message: 4
Date: Tue, 15 Oct 2002 19:10:57 -0400
To: email@hidden
From: "Daniel A. Shockley" <email@hidden>
Subject: Re: URL Access Scripting- post data

Hmm. I haven't read the list for a while, but noticed this sad
thread. Actually, URL Access Scripting has not been able to 'post
data' in any version of Mac OS X 10.1, and perhaps even earlier
versions as well. It seems that my copy of Jaguar manages to launch
the Classic version of UAS, and it even seems to work. I just curl,
instead, though, since it is very reliable and fast. It's a very
powerful command-line download utility, built into Mac OS X 10.1 and
higher. To read more about curl's features, type man curl in
Terminal.app.

Here's a quick sample that uses a sample post-processing CGI and
saves the results to a file named somefile.html on your desktop. It's
much faster, but you don't get the 'unpacking' or 'with progress'
features of UAS:

set downloadURL to "http://www.idocs.com/cgi-bin/mycgi.pl";

set theFormInfo to "realname=George the Wonder
Boy&email=email@hidden&" & ,
"nosmoke=on&myself=Here's my little bio about myself."

set destExpected to (path to desktop as string) & "somefile.html"

try
set curlCode to "curl \"" & downloadURL & "\""

set unixDestExpected to POSIX path of (destExpected as string)
set curlCode to curlCode & " --output \"" & unixDestExpected & "\""

if (length of theFormInfo) > 0 then
set hasFormInfo to true
else
set hasFormInfo to false
end if

if hasFormInfo then
set curlCode to curlCode & " -d \"" & theFormInfo & "\""
end if

set curlResponse to do shell script curlCode

on error errMsg number errNum
error "Could not download " & downloadURL & " (using 'curl') due to
the following error: " & errMsg
end try
_______________________________________________
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.

  • Prev by Date: Re: Assigning privs with AS
  • Next by Date: Re: Pie chart importing script-success!!!!
  • Previous by thread: Re: URL Access Scripting- post data
  • Next by thread: Is it possible to set up an 'instant' idle handler
  • Index(es):
    • Date
    • Thread