31.03.2017, 14:22
Hi,
If you just need a simple datafield you can also use:
BR,
Erwin
If you just need a simple datafield you can also use:
Code:
require('socket.http')
socket.http.TIMEOUT = 5
-- Get data from website
local data = socket.http.request('http://openrb.com')
-- Check if data is received
if not data then
log('No data found')
return
end
-- Find your data
for i in string.gmatch(data, '<body>.-</body>') do
if i ~= nil then
searched_data = i:match([[<h2>(.-)</h2>]])
if i ~= nil then
log(searched_data)
end
end
end
Erwin