Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

get html with lua

Tags:

lua

Halo,

I'm trying to make a awesome widget. I would like do download information from a website but I don't know lua and I didn't found anything good on the web.

I would like to pass in a domainname or a IP and get back the html code.

Thanks for your help.

like image 349
nickik Avatar asked Dec 29 '10 10:12

nickik


2 Answers

I would recommend using LuaSocket. It is probably included in your system package manager's repositories and if not you can easily get it with LuaRocks.

$ luarocks install luasocket
$ lua
> require 'luarocks.require'
> http = require 'socket.http'
> html = http.request 'http://www.google.com'
like image 130
ponzao Avatar answered Sep 21 '22 19:09

ponzao


Check out http://lua-curl.luaforge.net/.

like image 44
Juho Vepsäläinen Avatar answered Sep 20 '22 19:09

Juho Vepsäläinen