//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f. pragma solidity ^0.8.0; contract Example { struct Weather { bytes32 temp; bytes32 desc; } Weather[] weatherArray; mapping (bytes32 => uint256) requestToIdx; function requestWeather( bytes32 _jobId, address _oracle ) public { uint256 fee = 0.1 * 10 ** 18; // whatever the fee is?? Chainlink.Request memory requestOne = buildChainlinkRequest(_jobId, address(this), this.fulfillTemp.selector); Chainlink.Request memory requestTwo = buildChainlinkRequest(_jobId, address(this), this.fulfillDesc.selector); requestOne.add("get", "{{endpoint}}"); requestOne.add("copyPath", "PATH.TO.TEMP"); requestTwo.add("get", "{{endpoint}}"); requestTwo.add("copyPath", "PATH.TO.DESC"); requestIdOne = sendChainlinkRequestTo(_oracle, requestOne, fee); requestIdTwo = sendChainlinkRequestTo(_oracle, requestTwo, fee); Weather memory weather; weatherArray.push(weather); requestToIdx[requestIdOne] = weatherArray.length - 1; requestToIdx[requestIdTwo] = weatherArray.length - 1; } function fulfillTemp( bytes32 _requestId, bytes32 _data ) public recordChainlinkFulfillment(_requestId) { uint256 idx = requestToIdx[_requestId]; Weather storage weather = weatherArray[idx]; weather.temp = _data; } function fulfillDesc( bytes32 _requestId, bytes32 _data ) public recordChainlinkFulfillment(_requestId) { uint256 idx = requestToIdx[_requestId]; Weather storage weather = weatherArray[idx]; weather.desc = _data; } }
0.4.18