• 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 16:18:37 +1100

Thank you Phil & Steve.

There seems to be some sort of underlying problem.

To start, I’ll make sure you know what I’m trying to do.

On my home folder of my website I have two websites…


I have created a folder at the same level, ‘Email List’

In this I have created a txt file, 'Used Emails.txt', using the file creator of Rapid Weaver.

I want to read that txt file, check there is no more than 2 given copies of a particular email address in it, and if not, add the email address and the company name at the end of the text file, as a list.

I’ve tried following your advice, and also tried to open the page, and the folder, and the txt file, using Safari.

However, I’m getting a double colon in the Safari error message, and simply don’t know why! (/http/::)


I’ve also ensured I have full stop where every name on the site lists as a space.

And, Phil, using System Events is a habit, as I often write and text ASCObjC code in Script Editor, or Script Debugger, and just copy and paste when it’s working. Use the same variables. Also why I used the ‘my ‘. I’ve just found it a good habit to get into.
 

property EmailAddress : "email@hidden"
property businessName : “meSelfSoftWare.com"


http://meselfsoftware.com
http://meselfsoftware.com/Mail Manager/
http://meselfsoftware.com/Art Archiver Secretary/



set theCheckPath to "http://meselfsoftware.com/Email list/Used Emails.txt"

 

tell application "Safari"
open theCheckPath
end tell

try
# set (my theEmailList) to do shell script "curl " & theCheckPath
# set (my theEmailList) to do shell script "curl file_get_contents " & theCheckPath
#  do shell script "curl  file_get_contents " & theCheckPath & " echo " & (my theEmailList)
set theEmailList to do shell script "curl " & theCheckPath
on error
say 0.1
set theEmailList to {}
end try
try
if kind of theEmailList is not list then set theEmailList to {}
on error errmsg number errnum
if errnum = -1728 then set theEmailList to {}
end try
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 " & theEmailList & " --url " & theCheckPath
on error errmsg
tell application "System Events" to display dialog errmsg
end try


theEmailList

 _______________________________________________
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: Oakman <email@hidden>
References: 
 >Advice required with cURL, please! (From: Brian Christmas <email@hidden>)
 >Re: Advice required with cURL, please! (From: Steve Mills <email@hidden>)
 >Re: 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