Advertisement
Guest User

Untitled

a guest
Feb 3rd, 2016
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.64 KB | None | 0 0
  1. <?php
  2. /**
  3. * Created by JetBrains PhpStorm.
  4. * User: hexxy
  5. * Date: 2/3/16
  6. * Time: 9:43 PM
  7. * To change this template use File | Settings | File Templates.
  8. */
  9.  
  10.  
  11. function initCurl($Url){
  12. $ch = curl_init();
  13. curl_setopt($ch, CURLOPT_URL, $Url);
  14. curl_setopt($ch, CURLOPT_COOKIEJAR, dirname(__FILE__) . '/cookie.txt');
  15.  
  16. $headers = [
  17. 'Host: olymptrade.com',
  18. 'Connection: keep-alive',
  19. 'Cache-Control: max-age=0',
  20. 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
  21. 'Upgrade-Insecure-Requests: 1',
  22. 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.85 Safari/537.36',
  23. 'Accept-Language: en-US,en;q=0.8,ru;q=0.6',
  24. 'Cookie: jv_enter_ts_5hPq7ITZ0Q=1451336079735; jv_visits_count_5hPq7ITZ0Q=1; jv_email_5hPq7ITZ0Q=hexxyg%40gmail.com; jv_client_name_5hPq7ITZ0Q=Andrey; _ym_uid=1451336522319185580; jv_client_id_5hPq7ITZ0Q=192256.3L0krHeZgxrO2a9%2Bk8yAHno2YLC4BXMIPbX2cjVpjK0; jv_pages_count_5hPq7ITZ0Q=15; jv_gui_state_5hPq7ITZ0Q=WIDGET; ref_c=olymp; ref=olymp; land=olymp; checked=1; dguid=_539326; _ym_isad=1; props[deal_oneClick]=true; props[chart_periodl]=1; props[chart_format]=line; _gat=1; session=0df246u3d70l253046ducjaoj5; _ga=GA1.2.856487965.1451336077'
  25. ];
  26. curl_setopt($ch, CURLOPT_HEADER, true);
  27. curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
  28. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  29. curl_setopt($ch, CURLOPT_TIMEOUT, 10);
  30. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  31.  
  32. return $ch;
  33. }
  34.  
  35. function setPostData($curl, $data)
  36. {
  37. curl_setopt($curl, CURLOPT_POST, true);
  38. curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
  39.  
  40. }
  41.  
  42. function getResponse($curl)
  43. {
  44. $output = curl_exec($curl);
  45. return $output;
  46. }
  47.  
  48. $curl = initCurl('https://olymptrade.com');
  49. $data = getResponse($curl);
  50.  
  51. curl_setopt($curl, CURLOPT_URL, 'https://olymptrade.com/user/login?_=1454526316.06');
  52. // login
  53. $postData = urlencode('email=hexxyg@gmail.com&password=astharot&remember=true');
  54. setPostData($curl, $postData);
  55.  
  56. $data = getResponse($curl);
  57.  
  58. curl_setopt($curl, CURLOPT_URL, 'https://olymptrade.com/platform');
  59. curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'GET');
  60. curl_setopt($curl, CURLOPT_POST, false);
  61. curl_setopt($curl, CURLOPT_POSTFIELDS, null);
  62. $data = getResponse($curl);
  63.  
  64.  
  65. curl_setopt($curl, CURLOPT_URL, 'https://olymptrade.com/user/playdemo?_=1454527045.039');
  66. $data = getResponse($curl);
  67.  
  68.  
  69. curl_setopt($curl, CURLOPT_URL, 'https://olymptrade.com/deal/open?amount=100&duration=60&dir=up&pair=EURUSD&source=platform');
  70. $data = getResponse($curl);
  71. echo $data;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement