Advertisement
Guest User

Untitled

a guest
Nov 13th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. <?php
  2.  
  3. ini_set('display_errors', 'On');
  4. error_reporting(E_ALL);
  5.  
  6. // Generate random amount between .001 and .0015
  7. $ran1 = mt_rand(100, 150);
  8. $ran2 = $ran1/100000;
  9.  
  10. // Config
  11. $APIKey = "10636657564a65571683e85b8404e7";
  12. $APISecret = "e8a81007e17647fe04334f133c926d9931c55cb1";
  13. $Pair = "gmebtc";
  14. $Rate = "0.0001";
  15. $Nonce = time();
  16.  
  17. // Post Request
  18.  
  19. $Request = "https://api.altilly.com/api/order?key=" . $APIKey . '&secret=' . $APISecret . '&market=' . $Pair . '&quantity=' . $ran2 . '&rate=' . $Rate . '&nonce=' . $Nonce;
  20.  
  21.  
  22. $ch = curl_init($Request);
  23.  
  24. curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
  25. curl_setopt($ch, CURLOPT_POSTFIELDS, $Request);
  26. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  27. curl_setopt($ch, CURLOPT_HTTPHEADER, array(
  28. 'Content-Type: application/json',
  29. 'version: 1.0.2',
  30. 'Authorization: code sadkj4-sadj-as22-asdk2',
  31. 'Content-Length: ' . strlen($Request))
  32. );
  33.  
  34. // disable cert validation and settings
  35. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  36. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); // shouldn't need this
  37.  
  38.  
  39. $result = curl_exec($ch);
  40.  
  41.  
  42. // return response
  43. echo $result
  44.  
  45.  
  46.  
  47. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement