Cuberite Forum
How do I go about getting url contents in lua? - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Plugins (https://forum.cuberite.org/forum-1.html)
+--- Forum: Plugin Discussion (https://forum.cuberite.org/forum-8.html)
+--- Thread: How do I go about getting url contents in lua? (/thread-217.html)



How do I go about getting url contents in lua? - rs2k - 11-09-2011

Is this something I can use?
http://www.mc-server.org/wiki/doku.php?id=api:webplugin:httprequest

If so, can an example be provided?


RE: How do I go about getting url contents in lua? - rs2k - 11-10-2011

This works: (Thanks Kwen!)


local fp = io.popen('wget -U"Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6" "URL'" -o NUL -Otemp.html >NUL')
fp:close()
fp = io.open("temp.html","r")

need to download and install wget for it to work on windows.