19
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
this post was submitted on 11 Dec 2023
19 points (95.2% liked)
Linux
5240 readers
124 users here now
A community for everything relating to the linux operating system
Also check out !linux_memes@programming.dev
Original icon base courtesy of lewing@isc.tamu.edu and The GIMP
founded 1 year ago
MODERATORS
This looks like a combination of JSONP and the ES2015 computed property name syntax. JSONP is used to load into web pages using a script tag and execute the function (item) with the data, rather than a direct response from Ajax.
As for tools, jq may be able to parse this assuming you remove the item( and the last );
It's similar, but JavaScript would use
:
and,
for separators rather than=
and;
.This is valid Lua table syntax, however. A program creates an embedded Lua environment with an
item
callback function and runs this file inside it. Something similar could be done to convert it to another format; just defineitem
to output the data as JSON, or whatever other format you prefer.The Prosody XMPP server, written in Lua, generates files of this type when serializing lists with the "internal" storage manager. See functions
list_store
andlist_load
in util/datamanager.lua.Possibly lua? I think it supports brackets and semi-colon from a quick google search, but I could be wrong. Not able to test this moment.