cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Enable javascript with curl

From: Doug McNutt <douglist_at_macnauchtan.com>
Date: Fri, 13 May 2016 10:56:11 -0400

I just came back from a visit to the list for Apple's Applescript users
where a user was having trouble using curl. The http: URL was addressing
an HTML document that doesn't exist. The call to curl was initiating a
bunch of javascript that Apple was using to create an image on the
screen that appeared to be a file but really wasn't.

A regular helper offered this:

### begin copy
do shell script "curl https://support.apple.com/fr-fr/HT1582 >>
/User/YourIdHere/myLocalFile.html "

delay 2

tell application "Finder" to open file
“YourHD:Users:YourIdHere:myLocalFile.html"
### end copy

Not using a -o "xx" or a -O made all the difference. Somehow the curl
address resulted in running all of the javascript in Apple's home
machine where something like apache did the work.

Apple's Finder application recognizes /myLocalFile.html file as
something that can be displayed and likely passes control to Apple's
browser. There it would not be able to access the files available to
javascript running on the, now remote, Apple corporate server. But it
apparently works!

So: Redirecting curl's stdout to a new file is not always the same as
asking for a file to be saved in a home directory.

Is that an accident or have I been misusing curl for the last two decades?

ref:
AppleScript-Users mailing list (applescript-users_at_lists.apple.com)
Thu, 12 May 2016 15:55:53 +0000 Ed Stockly
"Downloading a file from the internet with a URL"
was the initial message in the mailing list.
-------------------------------------------------------------------
List admin: https://cool.haxx.se/list/listinfo/curl-users
FAQ: https://curl.haxx.se/docs/faq.html
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2016-05-13