No need to use tag code any more. REST API is now available as
Code: Select all
api.method_name
here how you can use Lua code on wapka Script:
Code: Select all
--user list using wapka script
local param = {
limit = 10, --> maximum 10 item
order = "id_desc"
}
local is_ok, userlist = api.user_info(param) --> calling rest api method for user list
print(userlist); --> show result
Code: Select all
--file list using wapka script
local tags = [=[
<tr><td width="23%" align="left" valign="top" margin="auto">
<img src="%thumb%" title="%name%" name="%name%" alt="%name%" width="65" height="56" style="border-radius:2px;"/>
<br/></td><td align="left"><a href="/download/%id%/%name|slug%"><b>%name%.%format%</b></a><br/>
<b><font color="gold">Size:</font></b> %size%<br/><b><font color="gold">Upload at: </font> </b> %date|date%</td></tr>
<tr><td colspan="2" align="left"><div style="background:#444;border-top: 1px solid #505050;padding:3px 0px 3px 6px;margin:0px 0px 0px 0px;">
<font color="gold"><b> Category:</b> </font>
<a href="/category/%dir%/%dirname|slug%" style="color:#ddd"><b>%dirname%</b></a> </div>
</td></tr>
]=]
local param = {
limit = 10, --> maximum 10 item per page
order = "id_desc"
}
local is_ok, list = api.file_info(param) --> calling rest api method for file list
if is_ok then
print(html.render_tag(tags, list, true)); ---> render all item recursively
end
print(list); --> view all as json
Stay tuned we will add full information soon.
To learn more about lua go to: https://jonayed-hossan.com/learn-lua-sc ... -language/