This is a possible method with scripting. This is from a work in progress so it is a bit messy with commented out lines. It is fetching XML from a local server in the "onprepare" event. I'm not going to try to explain it right now since I am busy, but sometimes all someone needs is an example.
Dim fetcher as Object
Dim arr as Object
Dim rotx as Double
fetcher = CreateObject("MSXML2.XMLHTTP")
fetcher.open("GET","http://10.1.1.101/cgi-bin/z_getcam4.py",false)
'fetcher.setRequestHeader("Cache-Control","no-cache, must-revalidate")
'fetcher.setRequestHeader("Pragma","no-cache")
fetcher.send()
'Engine.WriteToLog(fetcher.responseText)
Dim Cam as xpBaseObject
Self.GetObjectByName("CameraControl",Cam)
Try
arr = fetcher.responseXML.SelectNodes("//axis[@name='rotx']")
Dim c as Object
Engine.WriteToLog("Do Loop")
For Each c In arr
Engine.WriteToLog("-tick")
'If c.getAttribute("name") And c.getAttribute("calc") Then
'Engine.WriteToLog(c.getAttribute("calc"))
Engine.WriteToLog("RotX--" & c.getAttribute("calc"))
Double.TryParse(c.getAttribute("calc"),rotx)
Cam.RotX=-rotx
Engine.WriteToLog("RotX" & Cam.RotX)
'End If
Next
Catch oops as Exception
Engine.WriteToLog(oops.Message)
'Engine.WriteToLog("V")
End Try
'Engine.WriteToLog("x")
fetcher = Nothing
You can do JSON also and put the script in a loop instead if you wanted.
Note the commented out lines for caching. The no-caching headers NEED to come from the server. If those headers are NOT in the data then the data will NOT change from the initial request. That was a painful learning experience.
Hope this is helpful or inspirational!
------------------------------
Azathoth
Son of Cthulhu
------------------------------
Original Message:
Sent: 01-21-2024 10:45
From: Nathaniel Rudolph
Subject: Getting Live Data From a Website
Hello I am using Xpression for a college and they use Genius Sports for live stats. I just need some way to get those live stats into Datalinq. I have tried just putting the link from the stats website into the http/rss source but it doesn't work. I was also thinking an excel sheet could pull from it but when we have to use the legacy sharing feature those type of data inputs aren't allowed. Has anyone had to do thi with Genius Sports/NCAA stats software? I am just not sure how to do this. Thank you!
------------------------------
Nathaniel Rudolph
Xpression Graphics Operator
CSBN
------------------------------