06.03.2019, 22:41
(This post was last modified: 06.03.2019, 22:44 by Erwin van der Zwart.)
Hi,
What you could do is create a .lp to do the request like this (run once to create the .lp in the user folder) and a request with http://192.168.0.10/user/request.lp?tag=yourtag and you will get a JSON response back with the objects that has the requested tag.
BR,
Erwin
What you could do is create a .lp to do the request like this (run once to create the .lp in the user folder) and a request with http://192.168.0.10/user/request.lp?tag=yourtag and you will get a JSON response back with the objects that has the requested tag.
Code:
-- use this path for request: http://192.168.0.10/user/request.lp?tag=yourtag
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
response = grp.tag(tagname)
response = json.encode(response)
print(response)
end
?>
]])
script.disable(_SCRIPTNAME)
Erwin