Posted 21 July 2012 - 09:26 PM
Hello
I tried this code, directly copied from the wiki:
If we use print() instead of write() it outputs
So what should I do to get the contents of the webpage? What I want to accomplish is something similar to
if sExample == "1" then
redstone.setoutput(top,true)
etc…
But this is not possible since I can't find any way to access the content inside the table. Any suggestions?
Solution:
I tried this code, directly copied from the wiki:
local sExample = http.get("http://mywebpage.com/")
write(sExample)
and it outputsbios:48: bad argument: string expected, got table
If we use print() instead of write() it outputs
table: 2e619eb7
instead (where 2e619eb7 is an unique string that changes every time I run the script).So what should I do to get the contents of the webpage? What I want to accomplish is something similar to
if sExample == "1" then
redstone.setoutput(top,true)
etc…
But this is not possible since I can't find any way to access the content inside the table. Any suggestions?
Solution:
sExample = http.get("http://example.com/")
print(sExample.readAll())
Edited on 21 July 2012 - 09:12 PM