• 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
Re: Advice required with cURL, please!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Advice required with cURL, please!


  • Subject: Re: Advice required with cURL, please!
  • From: Brian Christmas <email@hidden>
  • Date: Mon, 23 Oct 2017 14:44:13 +1100

Steve, thanks for trying, but your code, and my slightly amended code, both
return…

Can’t set end of "<!DOCTYPE html>
<html style=\"height:100%\">
<head><title> 404 Not Found
</title></head>
<body style=\"color: #444; margin:0;font: normal 14px/20px Arial, Helvetica,
sans-serif; height:100%; background-color: #fff;\">
<div style=\"height:auto; min-height:100%; \">     <div style=\"text-align:
center; width:800px; margin-left: -400px; position:absolute; top: 30%;
left:50%;\">
        <h1 style=\"margin:0; font-size:150px; line-height:150px;
font-weight:bold;\">404</h1>
<h2 style=\"margin-top:20px;font-size: 30px;\">Not Found
</h2>
<p>The resource requested could not be found on this server!</p>
</div></div></body></html>" to {{"email@hidden"}, {"meSelfSoftWare.com"}}.

What I want is the CONTENT of the file, not its properties, please?

AND, is my saving line correct?

I’m completely guessing, and Shane’s told me ‘DON’T GUESS!’, BUT I CAN’T WORK
THE TERMINOLOGY OUT!.

What I THINK I’m doing wrong is addressing the .txt file in the wrong way.
<p>The resource requested could not be found on this server!</p> I have no idea
what I’m supposed to do, and have read the cURL help and examples over and
over. I just cannot wrap my mind around what I’m doing wrong!

Regards

Santa

property EmailAddress : "email@hidden"
property businessName : "meSelfSoftWare.com"
property theEmailList : {}


set theCheckPath to "http://meselfsoftware.com/xxxxx list/xxxx Email.txt/“
# Modified for posting

set (my theEmailList) to {}
try
        say 0
        set (my theEmailList) to do shell script "curl file_get_contents " &
theCheckPath
        # set (my theEmailList) to do shell script "curl  " & theCheckPath #
Steve’s script
        # do shell script "curl  file_get_contents " & theCheckPath & " echo "
& (my theEmailList)
on error
        say 0.1
        set (my theEmailList) to {}
end try
if (count of (my theEmailList)) = 0 then set (my theEmailList) to {}
say 1
try
        set end of theEmailList to {{EmailAddress}, {businessName}}
on error errmsg
        set end of theEmailList to {{EmailAddress}, {businessName}}
        tell application "System Events" to display dialog errmsg
end try
say 2
try
        do shell script "curl -T -d " & (my theEmailList) & " --url " &
theCheckPath
on error errmsg
        tell application "System Events" to display dialog errmsg
end try


theEmailList

I’m deriving the path from this… which is in the same site folder

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
<plist version="1.0">
<dict>
        <key>URL</key>
        <string>http://meselfsoftware.com/Mail Manager/</string>
</dict>
</plist>

The Site Inspector say their folder is /home/meselfso






> On 23 Oct 2017, at 1:50 pm, Steve Mills <email@hidden> wrote:
>
> On Oct 22, 2017, at 20:53:06, Brian Christmas <email@hidden> wrote:
>>
>> G’day scripters
>>
>> I want to read a remote .txt file using cURL, and save the result to a
>> variable, NOT a file.
>
> set x to do shell script "curl " & theURL
>
> --
> Steve Mills
> Drummer, Mac geek
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> AppleScript-Users mailing list      (email@hidden)
> Help/Unsubscribe/Update your Subscription:
> Archives: http://lists.apple.com/archives/applescript-users
>
> This email sent to email@hidden

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Advice required with cURL, please!
      • From: Steve Mills <email@hidden>
References: 
 >Advice required with cURL, please! (From: Brian Christmas <email@hidden>)
 >Re: Advice required with cURL, please! (From: Steve Mills <email@hidden>)

  • Prev by Date: Re: Advice required with cURL, please!
  • Next by Date: Re: Advice required with cURL, please!
  • Previous by thread: Re: Advice required with cURL, please!
  • Next by thread: Re: Advice required with cURL, please!
  • Index(es):
    • Date
    • Thread