I need to generate 10 unique random numbers between 0 to 100 in my smart contract.
For this I've decided to utilise Oracalize and one of the datasource called WolframAlpha
. This is how I use it:
function loadNewRandomNumbers() public payable {
oraclizeID = oraclize_query("WolframAlpha", "10 unique random numbers between 0 and 100");
}
I've deployed this to Ropsten
test net and executed the loadNewRandomNumbers
function and everything worked and I have the result from calling the wolfram alpha api datasource:
This is great so far; but I need to parse the string
(json-like) response - so that I can use it; Ideally parse the response into an uint array
.
How can I go about doing this? Is there a way parse the above string response into a usable format?