 |
 |
Using POST method from AppleScript
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Feb 2001
Location: Huddersfield, UK
Status:
Offline
|
|
This is the challenge that I decided to undertake today: To write an AppleScript that will send my IP address to my mobile phone in an SMS message.
Anyhow... I have a free SMS messaging service from my ISP (<a href="http://www.tiscali.co.uk/login/index.php?url=/commscentre/sms/form.php" target="_blank">Tiscali</a>)and this uses a series of forms made by PHP to: </font></li>[*]<font size="1" face="Geneva, Verdana, Arial, sans-serif">a) login</font></li>[*]<font size="1" face="Geneva, Verdana, Arial, sans-serif">b) enter the mobile number and text message and</font></li>[*]<font size="1" face="Geneva, Verdana, Arial, sans-serif">c) confirm the sending of the text message
Now this got me a bit stuck because all of these forms use the POST method (form action="foo" method="POST") and I don't know how to send my details to the server in order to send the text message.
I figured that if it used the (more insecure) GET method, I could just use: "open location target_URL" where target_URL includes the data pairs after the "/login.php?"
However, this is not the case. I've looked in the URL access scripting dictionary and the closest thing I've found to what I'm looking for is this:
download string form data string
Could someone please provide some pointers on how to send data to a PHP script using the POST method (websites, sample code etc. would be appreciated)
Thanks for your time,
Richard
|
|
PM G4 DP 500 MHz, 768 Mb, DVD-ROM, 85 Gb, Mac OS X 10.3.9
PB G4 1.25 GHz, 512 Mb, DVD-R, 80 Gb, Mac OS X 10.4
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Oct 1999
Location: :ИOITAↃO⅃
Status:
Offline
|
|
I would use the command-line curl program.
Do a man curl to learn about all of its (myriad and thorough) options, including doing a POST.
If you just want your IP address, what about using a free dynamic DNS service like <a href="http://www.dyndns.org" target="_blank">http://www.dyndns.org</a> ?
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Feb 2001
Location: Huddersfield, UK
Status:
Offline
|
|
Thanks for the heads-up! I'll read through the (very extensive) man pages...
I would use DynDNS, but a) I thought that they stopped accepting new customers and b) This is a challenge that I would very much like to undertake!
Thanks again,
Richard
|
|
PM G4 DP 500 MHz, 768 Mb, DVD-ROM, 85 Gb, Mac OS X 10.3.9
PB G4 1.25 GHz, 512 Mb, DVD-R, 80 Gb, Mac OS X 10.4
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Jan 2001
Location: New York
Status:
Offline
|
|
(Off Topic) I'm not a big fan of having to use an NSTask via CURL to do a post. Anyone have a simpler way in cocoa (Objective-C not Applescript Studio).
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|