Hey Guys,
I am trying to write a function which will get a list of all the blocks used in a Google Blockly program when the user saves it, and then save this list to MongoDB. I don't need help with MongoDB or anything, but I cannot find the Blockly function which will give me a list of all the blocks used. I've tried getAllBlocks(), which gives me a list of strings which are like pseudo-code and is not parsed into the individual blocks used, and I have tried getTopBlocks(), which just gives me a single string of pseudo-code. I would prefer not to use regex to try to parse the pseudo-code because there would be tons of ways the users could probably make programs which would break my code/lead to faulty data. Does anyone know if there is a function which I can use that will actually give me a list of the individual blocks used? Or, if there is anyone who has had this problem/done this before? I would really appreciate the help!
Thanks,
SC