I have been using CURL functionality to maintain and automatically up the
wbvista.info site and wanted to share some of the information.
The following is a very simple method to read a web page and place the response in a MUMPS local array.
The following routine, WBCURL, accepts a URL and the local array as input. It then makes a external function call to retrieve the web page in silent mode and store the page to a file. Once the file is stored, it is imported and placed in the local array and displayed. Simple.
WBCURL(URL,Result)
New Request,Outfile,line,count
Set Outfile="temp"_$I(^WBCURL)_".txt"
Set Request="curl -s -o "_Outfile_" "_URL
ZSYSTEM Request
;
Open Outfile:(readonly)
For Use Outfile Read line Quit:$zeof Do
. Set line=$Translate(line,$C(13),"")
. Set Result($I(count))=line
Close Outfile
;
Quit
;
TEST
New URL,TEMP
Set URL="
http://wbvista.info/VDOCS/Dictionary2/D5.php"
Do WBCURL(URL,.TEMP)
ZWR TEMP
Quit