用Lua检查网站文本?

如何检查这个文本是否说“真实”,如果是,就运行一段代码? http://api.roblox.com/ownership/hasasset?assetId=26943368&userId=13416513

点赞
用户2733013
用户2733013

使用luasocket.http.request从URL获取文本,然后将其与“true”进行比较。

local http = require "socket.http"

local text = http.request(url)
if text == "true" then
  -- it's true!
end
2013-12-08 21:19:11