Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function sendCurl($url, $is_post = false, $postdata = null){
- $request = curl_init($url);
- curl_setopt($request, CURLOPT_POST, $is_post);
- curl_setopt($request, CURLOPT_POSTFIELDS, $postdata);
- curl_setopt($request, CURLOPT_RETURNTRANSFER, TRUE);
- $response = json_decode(curl_exec($request),false);
- if(is_array($response)){
- return $response[0];
- }else{
- return $response;
- }
- }
- function getSalt(){
- return rand(1,10000);
- }
- class mcUser{
- public $id;
- public $fid;
- public $name;
- public $gps;
- public $jpid;
- public $spinsLeft;
- private $key;
- public function __construct($fbid, $fbname){
- $this->key = "4ATreS384Epepa2aHAFr";
- $this->fid = $fbid;
- $this->name = $fbname;
- $jpids = explode(" ", file_get_contents("jpcoords.txt"));
- $jpindex = rand(0,count($jpids));
- $jp_r = explode(",", $jpids[$jpindex]);
- $this->jpid = str_replace("%0A", "", urlencode($jp_r[0]));
- $this->gps = $jp_r[1] . " " . $jp_r[2];
- $salt = getSalt();
- $postdata = array(
- 'customer_fid' => $this->fid,
- 'customer_name' => $this->name,
- 'salt' => $salt,
- 'token' => hash('sha512', $this->key . $salt . $this->fid)
- );
- $response = sendCurl("http://mcdonalds.kiloo.com/index.php/customer_v4/login/", true, $postdata);
- $this->id = $response->customer_id;
- $this->spinsLeft = $this->checkJackpot();
- }
- public function collectCoin($coin){
- $salt = getSalt();
- $postdata = array(
- 'customer_id' => $this->id,
- 'customer_fid' => $this->fid,
- 'collection_type' => $coin,
- 'gps' => $this->gps,
- 'salt' => $salt,
- 'token' => hash('sha512', $this->key . $salt . $this->id . $coin . $this->gps . $this->fid)
- );
- $response = sendCurl("http://mcdonalds.kiloo.com/index.php/customer_v4/collect_coin/", TRUE, $postdata);
- return $response;
- }
- public function getCoins(){
- $salt = getSalt();
- $postdata = array(
- 'customer_id' => $this->id,
- 'customer_fid' => $this->fid,
- 'salt' => $salt,
- 'token' => hash('sha512', (string) $this->key . $salt . $this->id . $this->fid)
- );
- $response = sendCurl("http://mcdonalds.kiloo.com/index.php/customer_v4/get/collected_coins/", TRUE, $postdata);
- return $response->collected_coins;
- }
- public function checkJackpot(){
- $salt = getSalt();
- $getdata = array(
- 'customer_id' => urlencode($this->id),
- 'jackpot_id' => urlencode($this->jpid),
- 'salt' => urlencode($salt),
- 'token' => urlencode(hash('sha512', $this->key . $salt . $this->id))
- );
- $getString = "http://mcdonalds.kiloo.com/index.php/customer_v4/jackpot_status/?";
- foreach($getdata as $key => $value){
- $getString .= $key . '=' . $value . '&';
- }
- $URI = str_replace("%0A", "", rtrim($getString, '&'));
- $response = sendCurl($URI);
- return $response->available_spins;
- }
- public function spinJackpot(){
- for($i = 1; $i <= $this->spinsLeft; $i++){
- $salt = getSalt();
- echo "<b>Spin " . $i . ": </b>";
- $postdata = array(
- 'customer_id' => $this->id,
- 'jackpot_id' => $this->jpid,
- 'location' => $this->gps,
- 'salt' => $salt,
- 'token' => hash('sha512', $this->key . $salt . $this->id . $this->jpid . $this->gps)
- );
- $response = sendCurl("http://mcdonalds.kiloo.com/index.php/customer_v4/jackpot/", TRUE, $postdata);
- if($response->game_result){
- echo "Won " . $response->prize . "<br />";
- break;
- }
- echo "No prize<br />";
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement