I wish to use Oraclize to get prices for different ticker symbols. From the example
contract KrakenPriceTicker is usingOraclize {
string public ETHXBT;
event newOraclizeQuery(string description);
event newKrakenPriceTicker(string price);
function KrakenPriceTicker() {
oraclize_setProof(proofType_TLSNotary | proofStorage_IPFS);
update();
}
function __callback(bytes32 myid, string result, bytes proof) {
if (msg.sender != oraclize_cbAddress()) throw;
ETHXBT = result;
newKrakenPriceTicker(ETHXBT);
update();
}
function update() payable {
if (oraclize_getPrice("URL") > this.balance) {
newOraclizeQuery("Oraclize query was NOT sent, please add some ETH to cover for the query fee");
} else {
newOraclizeQuery("Oraclize query was sent, standing by for the answer..");
oraclize_query(60, "URL", "json(https://api.kraken.com/0/public/Ticker?pair=ETHXBT).result.XETHXXBT.c.0");
}
}
}
I wish to modify this contract to take a symbol as an input, not ETHXBT. I see the oraclize_query to have a fixed string, how can the query be changed to allow this?
oraclize_query(60, "URL", "json(https://api.kraken.com/0/public/Ticker?pair=ETHXBT).result.XETHXXBT.c.0");
I also wish to extent this with multiple arguments if requested in input, as an example
How to add this?