I have a vbscript code segment that I wish to access from PB Win.
The segment is:
EnableScript("VBScript");
<%
Public Sub callurl(varname,val)
Dim oXMLHTTP
Dim oStream
Set oXMLHTTP = CreateObject("Msxml2.ServerXMLHTTP")
token="xxmmfkfh58547n5ign" // dummy value not actual
url = "https://api.xx.xx/api?auth-token="+token+"&key="+varname+"&value="+val
oXMLHTTP.Open "GET", url, False
oXMLHTTP.setRequestHeader "Cache-Control", "no-cache"
oXMLHTTP.setRequestHeader "Pragma", "no-cache"
oXMLHTTP.Send
End Sub
%>
Then the calling program (Amibroker) does this:
pb = GetScriptObject();
if <some condition>
pb.callurl("NIFTY","2");
That's it. I assume I can write code in PBWin to call the vbscript Sub: callurl
But I am at a blank when it comes to internet programming. Could you nudge me in the right direction, please.
added: If there is some way to do this work without vbscript, please suggest.
Thanks,
Sudarshan Sukhani
The segment is:
EnableScript("VBScript");
<%
Public Sub callurl(varname,val)
Dim oXMLHTTP
Dim oStream
Set oXMLHTTP = CreateObject("Msxml2.ServerXMLHTTP")
token="xxmmfkfh58547n5ign" // dummy value not actual
url = "https://api.xx.xx/api?auth-token="+token+"&key="+varname+"&value="+val
oXMLHTTP.Open "GET", url, False
oXMLHTTP.setRequestHeader "Cache-Control", "no-cache"
oXMLHTTP.setRequestHeader "Pragma", "no-cache"
oXMLHTTP.Send
End Sub
%>
Then the calling program (Amibroker) does this:
pb = GetScriptObject();
if <some condition>
pb.callurl("NIFTY","2");
That's it. I assume I can write code in PBWin to call the vbscript Sub: callurl
But I am at a blank when it comes to internet programming. Could you nudge me in the right direction, please.
added: If there is some way to do this work without vbscript, please suggest.
Thanks,
Sudarshan Sukhani
Comment