07.03.2019, 03:14
Hi Erwin,
Thank you. That works, I have revised your script so I just return the object name and its value which is all I need. In case someone would find this useful the revised code is.
Thx
Roger
Thank you. That works, I have revised your script so I just return the object name and its value which is all I need. In case someone would find this useful the revised code is.
Code:
dst = '/www/user/request.lp'
io.writefile(dst, [[
<?
require('apps')
require('socket.url')
tagname = socket.url.unescape(getvar('tag') or 'nothing')
if tagname ~= 'nothing' then
local fb={}
response = grp.tag(tagname)
for index,value in ipairs(response) do
local tmp = { n=response[index].name, v=response[index].value }
fb[index] = tmp
end
response = json.encode(fb)
print(response)
end
?>
]])
script.disable(_SCRIPTNAME)
Thx
Roger