Advertisement
Guest User

class

a guest
Jul 20th, 2018
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.99 KB | None | 0 0
  1. <?php
  2. error_reporting(true);
  3. require __DIR__.'/autoload.php';
  4. use CloudflareBypass\RequestMethod\CFCurl;
  5.  
  6. class earnyourcrypto
  7. {
  8. protected $username;
  9. protected $email;
  10. protected $password;
  11.  
  12. public function __construct($email, $password, $username=null){
  13. $this->email = $email;
  14. $this->password = $password;
  15. $this->username = $username;
  16. }
  17.  
  18. public function signup(){
  19. $field = array('create_account'=>'Create+Account','email'=>$this->email,'password'=>$this->password,'signup-terms' => 'on','username' => $this->username);
  20. $signup = $this->postData('https://earnyourcrypto.com/', http_build_query($field));
  21. return $signup['info'];
  22. }
  23.  
  24. public function login(){
  25. $data = array('login'=>'Login','email'=> $this->email,'password'=> $this->password);
  26. $login = $this->postData('https://earnyourcrypto.com/', http_build_query($data));
  27. return $login['info'];
  28. }
  29.  
  30. public function logOut(){
  31. return $this->getData('https://earnyourcrypto.com/ok-logout');
  32. }
  33.  
  34. public function setWallet($wallet, $tag){
  35. if($this->getData('https://earnyourcrypto.com/settings')){
  36. $form = array('update_xrp_wallet'=>'Update+XRP+Wallet','xrp_deposit_address'=>$wallet,'xrp_deposit_tag'=> $tag);
  37. $postwallet = $this->postData('https://earnyourcrypto.com/settings/', http_build_query($form));
  38. }
  39. return $postwallet['info'];
  40. }
  41.  
  42. public function reqPayout(){
  43. if($this->getData('https://earnyourcrypto.com/exchange')){
  44. $info = $this->getInfo();
  45. $req = array('xrp_deposit_address' => $info['wallet'], 'xrp_deposit_tag' => $info['tag'], 'eyc_credits_exchange' => $info['balance'], 'request_payout' => 'Request+payout');
  46. $payout = $this->postData('https://earnyourcrypto.com/exchange/', http_build_query($req));
  47. }
  48. return $payout['info'];
  49. }
  50.  
  51.  
  52. public function getUrl(){
  53. $url = $this->getData('https://earnyourcrypto.com/visit-friends');
  54. $r = explode("var diezeUrl = '", $url['exec']);
  55. $g = explode("';", $r[1]);
  56. if($g[0] !=''){
  57. $link= $g[0];
  58. $this->saveAds($link);
  59. }else{
  60. $file = file('ads_url.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
  61. $link= $file[rand(0, count($file)-1)];
  62. }
  63. return $link;
  64.  
  65. }
  66.  
  67. public function saveAds($url){
  68. $file = fopen('ads_url.txt', 'a');
  69. fwrite($file,$url."\n");
  70. fclose($file);
  71. return $file;
  72. }
  73.  
  74.  
  75. public function getInfo(){
  76. $home = $this->getData('https://earnyourcrypto.com/settings');
  77. // INFO USERNAME
  78. $na = explode("<div class=\"border-b pb-15 mb-15\">\n", $home['exec']);
  79. $me = explode('<br>', $na[1]);
  80. // INFO BALANCE
  81. $ba = explode('<a class="font-size-lg" href="https://earnyourcrypto.com/exchange">$', $home['exec']);
  82. $la = explode('</a>', $ba[1]);
  83. // INFO WALLET
  84. $wa = explode('name="xrp_deposit_address" value="', $home['exec']);
  85. $let =explode('">', $wa[1]);
  86. // INFO TAG
  87. $ta = explode('name="xrp_deposit_tag" placeholder="" value="', $home['exec']);
  88. $g = explode('">', $ta[1]);
  89. //INFO EMAIL
  90. $em = explode('name="crypto-settings-email" placeholder="Enter your email.." value="', $home['exec']);
  91. $mail = explode('" disabled="yes">', $em[1]);
  92. $info['wallet'] = $let[0];
  93. $info['tag'] = $g[0];
  94. $info['balance'] = $la[0];
  95. $info['username'] = $me[0];
  96. $info['email'] = $mail[0];
  97. return $info;
  98. }
  99.  
  100. public function userAgent(){
  101. $file = file('user-agent.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
  102. return $file[rand(0, count($file)-1)];
  103. }
  104.  
  105. public function getData($url){
  106. $curl = new CFCurl(array('cache' => false, 'max_retries' => 3));
  107. $ch = curl_init();
  108. curl_setopt($ch, CURLOPT_URL, $url);
  109. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
  110. curl_setopt($ch, CURLOPT_AUTOREFERER, true);
  111. curl_setopt($ch, CURLOPT_HEADER,true);
  112. curl_setopt($ch, CURLOPT_USERAGENT, $this->userAgent);
  113. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  114. curl_setopt($ch, CURLOPT_COOKIEFILE, "cookie");
  115. curl_setopt($ch, CURLOPT_COOKIEJAR, "cookie");
  116. $get['exec'] = $curl->exec($ch);
  117. $get['info'] = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL);
  118. return $get;
  119. }
  120.  
  121. public function postData($url, $post){
  122. $curl = new CFCurl(array('cache' => false, 'max_retries' => null));
  123. $ch = curl_init();
  124. curl_setopt($ch, CURLOPT_URL, $url);
  125. curl_setopt($ch, CURLOPT_POST, true);
  126. curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
  127. curl_setopt($ch, CURLOPT_HEADER,true);
  128. curl_setopt($ch, CURLOPT_HTTPHEADER,"Content-Type: application/x-www-form-urlencoded");
  129. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
  130. curl_setopt($ch, CURLOPT_AUTOREFERER, true);
  131. curl_setopt($ch, CURLOPT_USERAGENT, $this->userAgent);
  132. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  133. curl_setopt($ch, CURLOPT_COOKIEFILE, "cookie");
  134. curl_setopt($ch, CURLOPT_COOKIEJAR, "cookie");
  135. $get['exec'] = $curl->exec($ch);
  136. $get['info'] = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL);
  137. return $get;
  138. }
  139. }
  140.  
  141. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement