Created
April 23, 2017 06:20
-
-
Save 3esmit/5874f05ca3d55b5805258acfb9a44a7e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.0; | |
import "github.com/oraclize/ethereum-api/oraclizeAPI.sol"; | |
contract GitHubAPITest is usingOraclize { | |
string public computationResult; | |
event newOraclizeQuery(string description); | |
event newResult(string result); | |
function __callback(bytes32 myid, string result) { | |
if (msg.sender != oraclize_cbAddress()) throw; | |
newResult(result); | |
computationResult = result; // let's save it as $ cents | |
// do something with the USD Diesel price | |
} | |
function update() payable { | |
newOraclizeQuery("Oraclize query was sent, standing by for the answer.."); | |
oraclize_query("computation", ["QmcetruTGVcFzM6zPZVHESyK9a4AbYZqVS1LtFzNiPE5Fe", "user-add","3esmit,31a58f2ddf2258697cce1b969e7c298b"]); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment