I’m not sure whether this will send you in the right direction, but I was testing Roar Engine a while back and this skeleton code works for parsing REST responses.
local xml = require( "xml" ).newParser()
local myXML
local function parse (xmlText)
print (#xmlText)
local parsedText = xml:ParseXmlText(xmlText)
print ("roar:" .. parsedText.name)
print ("tick:" .. parsedText.properties["tick"])
print ("info:" .. parsedText.child[1].name)
print ("ping:" .. parsedText.child[1].child[1].name)
print ("status:" .. parsedText.child[1].child[1].properties["status"])
print ("text:" .. parsedText.child[1].child[1].child[1].name)
print ("hello:" .. parsedText.child[1].child[1].child[1].value)
end
local function networkListener( event )
if ( event.isError ) then
print( "Network error!")
else
print ( "RESPONSE: " .. event.response )
myXML = event.response
parse (myXML)
end
end
network.request( "http://api.roar.io/YOUR\_PROJECT\_NAME/info/ping/", "GET", networkListener )
This will print out the Roar Engine response in the terminal window. [import]uid: 1560 topic_id: 23848 reply_id: 96090[/import]