This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ghetto_as_hell_parse_json(json) | |
processed_data = string.gsub(string.gsub(json, "\"", ""), ":", "=") | |
-- not even remotely secure, never use for anything important EVAR. | |
parsed = loadstring("return " .. processed_data)() | |
return parsed | |
end | |
json_data='{"p":07,"a0":4359021.16032269,"a1":0,"a2":83.955622485256754,"a3":174.96542675733608,"a4":179.99999446691439,"a5":300821.94285912672,"a6":0.99479834572486814,"a7":0.097586067257674255,"a8":211.47561250913216,"a9":84.824449329557083,"a10":4358745.3389826063,"a11":11.50312}' | |
-- n={p=07, a0=4359021.16032269, a1=0, a2=83.955622485256754, a3=174.96542675733608, a4=179.99999446691439, a5=300821.94285912672, a6=0.99479834572486814, a7=0.097586067257674255, a8=211.47561250913216, a9=84.824449329557083,a10=4358745.3389826063,a11=11.50312} |