presbyran 2 Posted February 4, 2013 Report Share Posted February 4, 2013 Hi guys Have looked around the forum and could find any info on hwo to work with JSON the best way?Anyone can point me to the right direction? Thanks Quote Link to post Share on other sites
mojpoj 0 Posted February 5, 2013 Report Share Posted February 5, 2013 I was looking at this the other day. Couldn't find anything useful on working with JSON in Ubot, so I turned to MySQL. Chances are if you are trying to work with JSON, you can do it with MySQL. Of course there are reasons why you wouldn't be able to. Some JSON features in Ubot would be great, but there are probably other bigger issues that are being resolved first. My original idea, and this may help you as you have a dev license. Request the JSON through a hidden browser, scrape the data and then do what you wish with it. Quote Link to post Share on other sites
whoami 26 Posted January 7, 2014 Report Share Posted January 7, 2014 Any updates on how to parse json with Ubot? Quote Link to post Share on other sites
UBotDev 276 Posted January 7, 2014 Report Share Posted January 7, 2014 Any updates on how to parse json with Ubot?I think this is what you are looking for:http://www.ubotstudio.com/forum/index.php?/topic/13725-json-parser/&do=findComment&comment=76556 Quote Link to post Share on other sites
goceb 0 Posted December 18, 2014 Report Share Posted December 18, 2014 (edited) The http://www.ubotstudio.com/forum/index.php?/topic/13725-json-parser/?p=76556 is great and it works but it lacks the check for loaded HTML in the browser, the condition needed in order for eval to always run properly. See the full post here http://devmd.com/r/parsing-json-ubot-studio and below is the code for quick reference define eval fix { set(#test,$eval("2+3"),"Local") if($comparison(#test,"=","")) { then { load html("An empty page was detected so eval() can not run. This is an auto generated HTML so that the function can be used!") } } } define $json value(#json, #key) { eval fix() return($eval("try\{var json_63a4e94d5e86 = {#json}; json_63a4e94d5e86.{#key};\}catch(err)\{json_63a4e94d5e86 = ''; json_63a4e94d5e86;\}")) } Edited December 18, 2014 by goceb Quote Link to post Share on other sites
UBotDev 276 Posted December 18, 2014 Report Share Posted December 18, 2014 The http://www.ubotstudio.com/forum/index.php?/topic/13725-json-parser/?p=76556 is great and it works but it lacks the check for loaded HTML in the browser, the condition needed in order for eval to always run properly. See the full post here http://devmd.com/r/parsing-json-ubot-studio and below is the code for quick reference Thanks to Aymen we have an easier way to deal with JSON now: http://www.ubotstudio.com/forum/index.php?/topic/16166-free-plugin-jsonpath-parser-plugin/ P.S.: For $eval to work you need JavaScript loaded inside the browser, HTML only won't help. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.