Scraping an entire data set
-
Thanks Phil! Super helpful as always.
That HttpBuilder function, what language is that part of? I ask because I'd like to see the documentation for it. Learning on the fly here :)
-
The HttpBuilder is a utility specific to Mango. You can find some notes about it in the "Mango JavaScript" help dialogue within Mango. It's linked to by the contextual help for all things that use scripts in the 'related items' section. Probably github is the only source that's always at least up to date for this file: https://github.com/infiniteautomation/ma-core-public/blob/main/Core/web/WEB-INF/dox/mangoJavaScript.htm
-
Just FYI, I can't find any mention of HttpBuilder in that Mango Scripting help.
Last question... for today :) While I'm on the topic, how about JSON.parse documentation?
-
I think I may have got it, I found some stuff in that Rhino syntax help :)
-
Nice! Yeah, it's a builtin object for JavaScript, generally. Just an FYI but the references to Rhino are dated. Mango 3 only runs on Java 8 which uses Nashorn as the engine. Most things should be very similar, but it may matter at some point.
-
OK thanks
-
Interesting, the context help in the mango jumps from RQL Examples to Logging and totally misses the HttpBuilder and Context sections. Thanks for the GIT link
-
MDN is a very good reference for all things JavaScript
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse -
Thanks @Jared-Wiltshire For anyone else possibly reading this, one of the issues I ran into there was the versions of the libraries, for example the RegExp command. The way it's documented there I don't think makes the Mango very happy
-
@psysak MDN will definitely contain references to a lot of new JavaScript features which aren't available in the Java 8 Nashorn engine which we leverage. Nashorn should be compliant with ECMAScript 5.1. The MDN pages tell you which version of ECMAScript (JavaScript) the feature is supported in. e.g. look under specifications on the JSON.parse() page, it says
ECMAScript 5.1 (ECMA-262)
The definition of 'JSON.parse' in that specification. Standard Initial definition. Implemented in JavaScript 1.7."