An open API service indexing awesome lists of open source software.

https://github.com/flaribbit/lua-www

Inspired by justjavac/proxy-www
https://github.com/flaribbit/lua-www

Last synced: 3 months ago
JSON representation

Inspired by justjavac/proxy-www

Awesome Lists containing this project

README

        

# lua-www

Inspired by [justjavac/proxy-www](https://github.com/justjavac/proxy-www)

```lua
local http = require "socket.http"

local www = {
url = "http://www",
__index = function(self, s)
self.url = self.url.."."..s
return self
end,
get = function(self, fun)
local b, s, h = http.request(self.url)
fun({body=b, status=s, header=h})
self.url = "http://www"
end
}
setmetatable(www, www)

www.baidu.com:get(function (res)
print(res.status, #res.body)
end)
```

Just for fun😉