Calling CGI-Script from Apple script

Hi All,
I am new to apple script i want to call a CGI-SCript in applescript and get its return value for e.g
https://www.test.com/cgi-bin/get_location?user=xyz this will return a value which i have to capture in a variable and process it.Please help me out ,a early solution will be very much appreciated.

Thanks in advance.
Regards
Suresh

Hi,

What happens if you do something like this:

tell application “Safari”
open location “https://www.test.com/cgi-bin/get_location?user=xyz
set t to text of front document
end tell
return t

gl,

Hi,
Thank you very much for the reply.In my case i dont want the browser to open,i want the script to get processed in the background and return the result alone.
Please help me out.Thanks in advance.
Regards
Suresh

This runs the test-cgi here:

set lib_ref to (path to “dlib” from local domain)
set lib_path to POSIX path of lib_ref
set script_ref to quoted form of (lib_path & “WebServer/CGI-Executables/test-cgi”)
do shell script script_ref

I don’t know how you would add those parameters.

gl,

Or like this:

do shell script “‘/Library/WebServer/CGI-Executables/test-cgi’”

Might be less confusing.

gl,

I think you can do it using “curl”. Ie:

set var to (do shell script "curl 'https://www.test.com/cgi-bin/get_location?user=xyz'")