Update: We just added scripting language support

Notice about any update or system change
Post Reply
Administrator
Site Admin
Posts: 33
Joined: Tue Mar 07, 2023 7:56 am

Update: We just added scripting language support

Post by Administrator »

Hello, finally we added support for programming language on wapka. Now any one can write php/python like code and do everything.
No need to use tag code any more. REST API is now available as

Code: Select all

api.method_name
library.
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
Old style html tag file list

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
All REST API function is converted to function so test it now and give your suggest so we and make it better.
Stay tuned we will add full information soon.
To learn more about lua go to: https://jonayed-hossan.com/learn-lua-sc ... -language/
User avatar
francisco
Posts: 58
Joined: Tue Mar 07, 2023 1:48 pm
Location: Brazil
Contact:

Re: We just added scripting language support

Post by francisco »

This is wild, I can't fathom how amazing this is 😲
vikkas
Posts: 62
Joined: Sun May 07, 2023 9:28 am

Re: We just added scripting language support

Post by vikkas »

Awesome bro, Super
shrmaprem0202
Posts: 38
Joined: Tue Mar 07, 2023 7:13 pm
Contact:

Re: We just added scripting language support

Post by shrmaprem0202 »

Please post a example of userlist with source code
vikkas
Posts: 62
Joined: Sun May 07, 2023 9:28 am

Re: We just added scripting language support

Post by vikkas »

Admin demo please
obaydulbc
Posts: 29
Joined: Tue Mar 07, 2023 1:37 pm

Re: Update: We just added scripting language support

Post by obaydulbc »

Awesome
Post Reply