lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 16 May 2015 at 21:06, Gilles <codecomplete@free.fr> wrote:
> On Fri, 15 May 2015 21:56:51 +0000, Thijs Schreijer
> <thijs@thijsschreijer.nl> wrote:
>>I think you would need a 'fetching' and a 'parsing' element. For fetching you could use Copas [1], which has recently gained async client support for http(s) (luasec required for the 's' part). See this example [2] for fetching multiple pages simultaneously/async.
>>
>>For parsing; depends on the complexity. If it's simple, use lua patterns. Otherwise the proposed lua-gumbo seems a good fit (just read the readme, have no experience with it).
>>
>>Thijs
>>
>>[1] https://github.com/keplerproject/copas
>>[2] https://github.com/keplerproject/copas/blob/master/tests/testlimit.lua
>
> Thanks for the infos. Are those available as LuaRocks? It's easier to
> install for newbies.
>
> "lua patterns" = regex?
>
>

Copas, LuaSocket and LuaSec are all available on LuaRocks.

Lua's patterns are similar to regular expressions, but are more limited:
http://www.lua.org/manual/5.3/manual.html#6.4.1