Skip to content

Instantly share code, notes, and snippets.

@centralhardware
Last active October 10, 2024 18:46
Show Gist options
  • Save centralhardware/2a12fbb4f7dce5c3db2cea4875899abc to your computer and use it in GitHub Desktop.
Save centralhardware/2a12fbb4f7dce5c3db2cea4875899abc to your computer and use it in GitHub Desktop.
function otr_init()
otr.log("example.lua starting; writing to /tmp/lua.out")
end
function otr_hook(topic, _type, data)
otr.log("curl -X POST -s 'http://10.168.0.77:7890/location?latitude=" .. data['lat'] .. "&longitude=" .. data['lon'] .. "&timezone=" .. data['tzname'] .. "&country=" .. data['cc'] .. "&userId=428985392" .. "'")
os.execute("curl -X POST -s 'http://10.168.0.77:7890/location?latitude=" .. data['lat'] .. "&longitude=" .. data['lon'] .. "&timezone=" .. data['tzname'] .. "&country=" .. data['cc'] .. "&userId=428985392" .. "'")
end
function otr_exit()
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment