Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function bitmarket_api($method, $params = array())
- {
- $key = "klucz_jawny";
- $secret = "klucz_tajny";
- $params["method"] = $method;
- $params["tonce"] = time();
- $post = http_build_query($params, "", "&");
- $sign = hash_hmac("sha512", $post, $secret);
- $headers = array(
- "API-Key: " . $key,
- "API-Hash: " . $sign,
- );
- $curl = curl_init();
- curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($curl, CURLOPT_URL, "https://www.bitmarket.pl/api2/");
- curl_setopt($curl, CURLOPT_POST, true);
- curl_setopt($curl, CURLOPT_POSTFIELDS, $post);
- curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
- $ret = curl_exec($curl);
- return json_decode($ret);
- }
- bitmarket_api("info");
- ?>
Advertisement
Add Comment
Please, Sign In to add comment