View Single Post
Old 03-22-2016, 08:05 PM   #6
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by NiLuJe View Post
Nice!

For those crazy people who actually like the Lua syntax... ;p.
Just for any Python lovers in the audience ('> ' is the interactive prompt).
Adding the PinLight loader (all PinLight functions are 'load on demand'), then extending the standard string library:
PHP Code:
> require'pl'
stringx.import()
url 'http://amazon.com/customer/complaints.html'
ut url:split('/')
> for 
kv in ipairs(ut) do print(kvend
1       http
:
2
3       amazon
.com
4       customer
5       complaints
.html
ut[1] = 'https:'
tt ut:concat('/')
> print(
tt)
https://amazon.com/customer/complaints.html 

Last edited by knc1; 03-22-2016 at 08:13 PM.
knc1 is offline   Reply With Quote