<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use \App\Rules\Count;
use DB;

class AutoController extends Controller
{
    
    public function __construct(){
        
    }
    
    public function auto(){
        return view('server.auto');
    }
    
    public function addauto(){
        $con = mysqli_connect('localhost', 'instagr9_panel', '#=ZR0.ZZ.[x7', 'instagr9_panel');
        $cek = mysqli_query($con, "SELECT * FROM auto WHERE submitted_by='".auth()->user()->username."'");
        
        
        
        if(mysqli_num_rows($cek) == 0){
            mysqli_query($con, "INSERT INTO auto VALUES(NULL, '".auth()->user()->id."','".auth()->user()->username."', '".request()->target."', '".date('Y-m-d')."')");
        }else{
            mysqli_query($con, "UPDATE auto SET target = '".request()->target."' WHERE submitted_by = '".auth()->user()->username."' ");
        }
        
        return back();
    }
    
    public function cronauto(){
        
        
        set_time_limit(10000);
        error_reporting(0);
        
        $con = mysqli_connect('localhost', 'instagr9_panel', '#=ZR0.ZZ.[x7', 'instagr9_panel');
        $query = mysqli_query($con, "SELECT * FROM auto LIMIT 10 OFFSET 0");
        while($data = mysqli_fetch_assoc($query)){
        
            $username  = $data['target']; # INPUT USERNAME TARGET HERE
            
            $useragent = 'Instagram 27.0.0.7.97 Android (18/4.3; 320dpi; 720x1280; Xiaomi; HM 1SW; armani; qcom; en_US)';
            $cookies   = 'ds_user=instamedia.co.id;shbid=155;shbts=1534506651.185972;rur=FTW;csrftoken=4QEAd8BJNSGTqwWsCsvkxQxaeHI7DOAh;mid=W3a2mgABAAGD9Er5fIbp7NT9Z73M;ds_user_id=7594907455;urlgen=\"{\\\"182.1.102.239\\\": 23693}:1fqdHH:HI8j_anm5-caDjyVAYsZx06rvPI\";sessionid=IGSC3fbd90b2c39f28944877b6acbfd5e7fff6fb05924cb2b66baa834c6d62552fc4%3AzT2Aco1apb0JpmVT8mRxVJHqQhYRpSab%3A%7B%22_auth_user_id%22%3A7594907455%2C%22_auth_user_backend%22%3A%22accounts.backends.CaseInsensitiveModelBackend%22%2C%22_auth_user_hash%22%3A%22%22%2C%22_platform%22%3A1%2C%22_token_ver%22%3A2%2C%22_token%22%3A%227594907455%3A2zgxLE6qYgzqkwSOs0u5PECU8ssWGUNQ%3A3afe52d6b3dbaf6acf732c272d9dc3f8a8bfeb6c90c2f5ef64d7769d0b112b76%22%2C%22last_refreshed%22%3A1534506651.1866247654%7D;mcd=3;'; # BISA DIGANTI PAKE COOKIES AKUN INSTAGRAM KALIAN, PAKE USERAGENT VERSION 27, KALO GA NGERTI DAPETINNYA BISA CHAT GW
            
            $getInfo = $this->request('https://i.instagram.com/api/v1/users/'.$username.'/usernameinfo/', $useragent, 0, $cookies);
            
            $getInfo = json_decode($getInfo[1]);

            print($getInfo);
            if($getInfo->user->is_private == true)
            {
                print 'Username '.$username.' Dalam Keadaan Private';
            }
            else
            {
                $userID = $getInfo->user->pk;
            }
            
            $userFeed = $this->request('https://i.instagram.com/api/v1/feed/user/'.$userID.'/', $useragent, 0, $cookies);
            $userFeed = json_decode($userFeed[1]);


            
            if($userFeed->status == 'ok')
            {
                
                $postUrl  = 'https://www.instagram.com/p/'.$userFeed->items[0]->code.'/';
                
                
                $cekpost = mysqli_query($con, "SELECT * FROM users_history WHERE target='".$postUrl."'");
                
                if(mysqli_num_rows($cekpost) == 0){
                    $ceklimit = DB::table('users_history')->whereDate('created_at', date('Y-m-d'))->where('type', 'Auto Like')->count();
                    
                    if($ceklimit <= 10){
                        $key = 'hgfghfghfgf657656756sadhghsadg';
                        $jml = 250;
                    
                        $this->proses2('https://103.52.147.51/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=2&quantity='.$jml);
                        $this->proses2('https://103.84.194.131/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=2&quantity='.$jml);
                        $this->proses2('https://103.252.100.74/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=2&quantity='.$jml);
                        $this->proses2('https://103.252.100.74/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=4&quantity='.$jml);
                        $uszz = "ivanz";
                    	$pws = "kntolz32";
                    	$result = $this->proses("http://167.99.202.150/kuy/bowokntolzx.php","urlxx={$postUrl}&jumlahlahx={$jml}",$uszz,$pws);
                    	$result = $this->proses("http://167.99.202.150/kuy/bowokntolzx.php","urlxx={$postUrl}&jumlahlahx={$jml}",$uszz,$pws);
                        
                        
                        $delay = 20;
                        
                        
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_4' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_1' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_6' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_5' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_7' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_8' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_9' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        
                        $history = new \App\History;
                        $history->submitted_by = $data['submitted_by'];
                        $history->target = $postUrl;
                        $history->type = 'Auto Like';
                        $history->total_submit = 1500;
                        
                        $history->ip = $_SERVER['REMOTE_ADDR'];
                        $history->save();
                    
                        echo '<p><span style="color:green">[SUKSES]</span>'.$postUrl.'</p>';
                    }
                }else{
                    echo '<p><span style="color:red">[GAGAL]</span>'.$postUrl.' Sudah di like!</p>';
                }
            }
            else
            {
                print 'Terjadi Kesalahan: '.$userFeed['message'];
            }
            
            sleep(10);
        }
        
    }
    
    public function cronauto1(){
        
        
        set_time_limit(10000);
        error_reporting(0);
        
        $con = mysqli_connect('localhost', 'instagr9_panel', '#=ZR0.ZZ.[x7', 'instagr9_panel');
        $query = mysqli_query($con, "SELECT * FROM auto LIMIT 10 OFFSET 10");
        while($data = mysqli_fetch_assoc($query)){
        
            $username  = $data['target']; # INPUT USERNAME TARGET HERE
            
            $useragent = 'Instagram 27.0.0.7.97 Android (18/4.3; 320dpi; 720x1280; Xiaomi; HM 1SW; armani; qcom; en_US)';
            $cookies   = 'ds_user=instamedia.co.id;shbid=155;shbts=1534506651.185972;rur=FTW;csrftoken=4QEAd8BJNSGTqwWsCsvkxQxaeHI7DOAh;mid=W3a2mgABAAGD9Er5fIbp7NT9Z73M;ds_user_id=7594907455;urlgen=\"{\\\"182.1.102.239\\\": 23693}:1fqdHH:HI8j_anm5-caDjyVAYsZx06rvPI\";sessionid=IGSC3fbd90b2c39f28944877b6acbfd5e7fff6fb05924cb2b66baa834c6d62552fc4%3AzT2Aco1apb0JpmVT8mRxVJHqQhYRpSab%3A%7B%22_auth_user_id%22%3A7594907455%2C%22_auth_user_backend%22%3A%22accounts.backends.CaseInsensitiveModelBackend%22%2C%22_auth_user_hash%22%3A%22%22%2C%22_platform%22%3A1%2C%22_token_ver%22%3A2%2C%22_token%22%3A%227594907455%3A2zgxLE6qYgzqkwSOs0u5PECU8ssWGUNQ%3A3afe52d6b3dbaf6acf732c272d9dc3f8a8bfeb6c90c2f5ef64d7769d0b112b76%22%2C%22last_refreshed%22%3A1534506651.1866247654%7D;mcd=3;'; # BISA DIGANTI PAKE COOKIES AKUN INSTAGRAM KALIAN, PAKE USERAGENT VERSION 27, KALO GA NGERTI DAPETINNYA BISA CHAT GW
            
            $getInfo = $this->request('https://i.instagram.com/api/v1/users/'.$username.'/usernameinfo/', $useragent, 0, $cookies);
            
            $getInfo = json_decode($getInfo[1]);

            print($getInfo);
            if($getInfo->user->is_private == true)
            {
                print 'Username '.$username.' Dalam Keadaan Private';
            }
            else
            {
                $userID = $getInfo->user->pk;
            }
            
            $userFeed = $this->request('https://i.instagram.com/api/v1/feed/user/'.$userID.'/', $useragent, 0, $cookies);
            $userFeed = json_decode($userFeed[1]);


            
            if($userFeed->status == 'ok')
            {
                
                $postUrl  = 'https://www.instagram.com/p/'.$userFeed->items[0]->code.'/';
                
                
                $cekpost = mysqli_query($con, "SELECT * FROM users_history WHERE target='".$postUrl."'");
                
                if(mysqli_num_rows($cekpost) == 0){
                    $ceklimit = DB::table('users_history')->whereDate('created_at', date('Y-m-d'))->where('type', 'Auto Like')->count();
                    
                    if($ceklimit <= 10){
                        $key = 'hgfghfghfgf657656756sadhghsadg';
                        $jml = 250;
                    
                        $this->proses2('https://103.52.147.51/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=2&quantity='.$jml);
                        $this->proses2('https://103.84.194.131/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=2&quantity='.$jml);
                        $this->proses2('https://103.252.100.74/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=2&quantity='.$jml);
                        $this->proses2('https://103.252.100.74/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=4&quantity='.$jml);
                        $uszz = "ivanz";
                    	$pws = "kntolz32";
                    	$result = $this->proses("http://167.99.202.150/kuy/bowokntolzx.php","urlxx={$postUrl}&jumlahlahx={$jml}",$uszz,$pws);
                    	$result = $this->proses("http://167.99.202.150/kuy/bowokntolzx.php","urlxx={$postUrl}&jumlahlahx={$jml}",$uszz,$pws);
                        
                        
                        $delay = 20;
                        
                        
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_4' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_1' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_6' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_5' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_7' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_8' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_9' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        
                        $history = new \App\History;
                        $history->submitted_by = $data['submitted_by'];
                        $history->target = $postUrl;
                        $history->type = 'Auto Like';
                        $history->total_submit = 1500;
                        
                        $history->ip = $_SERVER['REMOTE_ADDR'];
                        $history->save();
                    
                        echo '<p><span style="color:green">[SUKSES]</span>'.$postUrl.'</p>';
                    }
                }else{
                    echo '<p><span style="color:red">[GAGAL]</span>'.$postUrl.' Sudah di like!</p>';
                }
            }
            else
            {
                print 'Terjadi Kesalahan: '.$userFeed['message'];
            }
            
            sleep(10);
        }
        
    }
    
    public function cronauto2(){
        
        
        set_time_limit(10000);
        error_reporting(0);
        
        $con = mysqli_connect('localhost', 'instagr9_panel', '#=ZR0.ZZ.[x7', 'instagr9_panel');
        $query = mysqli_query($con, "SELECT * FROM auto LIMIT 10 OFFSET 20");
        while($data = mysqli_fetch_assoc($query)){
        
            $username  = $data['target']; # INPUT USERNAME TARGET HERE
            
            $useragent = 'Instagram 27.0.0.7.97 Android (18/4.3; 320dpi; 720x1280; Xiaomi; HM 1SW; armani; qcom; en_US)';
            $cookies   = 'ds_user=instamedia.co.id;shbid=155;shbts=1534506651.185972;rur=FTW;csrftoken=4QEAd8BJNSGTqwWsCsvkxQxaeHI7DOAh;mid=W3a2mgABAAGD9Er5fIbp7NT9Z73M;ds_user_id=7594907455;urlgen=\"{\\\"182.1.102.239\\\": 23693}:1fqdHH:HI8j_anm5-caDjyVAYsZx06rvPI\";sessionid=IGSC3fbd90b2c39f28944877b6acbfd5e7fff6fb05924cb2b66baa834c6d62552fc4%3AzT2Aco1apb0JpmVT8mRxVJHqQhYRpSab%3A%7B%22_auth_user_id%22%3A7594907455%2C%22_auth_user_backend%22%3A%22accounts.backends.CaseInsensitiveModelBackend%22%2C%22_auth_user_hash%22%3A%22%22%2C%22_platform%22%3A1%2C%22_token_ver%22%3A2%2C%22_token%22%3A%227594907455%3A2zgxLE6qYgzqkwSOs0u5PECU8ssWGUNQ%3A3afe52d6b3dbaf6acf732c272d9dc3f8a8bfeb6c90c2f5ef64d7769d0b112b76%22%2C%22last_refreshed%22%3A1534506651.1866247654%7D;mcd=3;'; # BISA DIGANTI PAKE COOKIES AKUN INSTAGRAM KALIAN, PAKE USERAGENT VERSION 27, KALO GA NGERTI DAPETINNYA BISA CHAT GW
            
            $getInfo = $this->request('https://i.instagram.com/api/v1/users/'.$username.'/usernameinfo/', $useragent, 0, $cookies);
            
            $getInfo = json_decode($getInfo[1]);

            print($getInfo);
            if($getInfo->user->is_private == true)
            {
                print 'Username '.$username.' Dalam Keadaan Private';
            }
            else
            {
                $userID = $getInfo->user->pk;
            }
            
            $userFeed = $this->request('https://i.instagram.com/api/v1/feed/user/'.$userID.'/', $useragent, 0, $cookies);
            $userFeed = json_decode($userFeed[1]);


            
            if($userFeed->status == 'ok')
            {
                
                $postUrl  = 'https://www.instagram.com/p/'.$userFeed->items[0]->code.'/';
                
                
                $cekpost = mysqli_query($con, "SELECT * FROM users_history WHERE target='".$postUrl."'");
                
                if(mysqli_num_rows($cekpost) == 0){
                    $ceklimit = DB::table('users_history')->whereDate('created_at', date('Y-m-d'))->where('type', 'Auto Like')->count();
                    
                    if($ceklimit <= 10){
                        $key = 'hgfghfghfgf657656756sadhghsadg';
                        $jml = 250;
                    
                        $this->proses2('https://103.52.147.51/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=2&quantity='.$jml);
                        $this->proses2('https://103.84.194.131/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=2&quantity='.$jml);
                        $this->proses2('https://103.252.100.74/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=2&quantity='.$jml);
                        $this->proses2('https://103.252.100.74/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=4&quantity='.$jml);
                        $uszz = "ivanz";
                    	$pws = "kntolz32";
                    	$result = $this->proses("http://167.99.202.150/kuy/bowokntolzx.php","urlxx={$postUrl}&jumlahlahx={$jml}",$uszz,$pws);
                    	$result = $this->proses("http://167.99.202.150/kuy/bowokntolzx.php","urlxx={$postUrl}&jumlahlahx={$jml}",$uszz,$pws);
                        
                        
                        $delay = 20;
                        
                        
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_4' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_1' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_6' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_5' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_7' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_8' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_9' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        
                        $history = new \App\History;
                        $history->submitted_by = $data['submitted_by'];
                        $history->target = $postUrl;
                        $history->type = 'Auto Like';
                        $history->total_submit = 1500;
                        
                        $history->ip = $_SERVER['REMOTE_ADDR'];
                        $history->save();
                    
                        echo '<p><span style="color:green">[SUKSES]</span>'.$postUrl.'</p>';
                    }
                }else{
                    echo '<p><span style="color:red">[GAGAL]</span>'.$postUrl.' Sudah di like!</p>';
                }
            }
            else
            {
                print 'Terjadi Kesalahan: '.$userFeed['message'];
            }
            
            sleep(10);
        }
        
    }
    
    public function cronauto3(){
        
        
        set_time_limit(10000);
        error_reporting(0);
        
        $con = mysqli_connect('localhost', 'instagr9_panel', '#=ZR0.ZZ.[x7', 'instagr9_panel');
        $query = mysqli_query($con, "SELECT * FROM auto LIMIT 10 OFFSET 30");
        while($data = mysqli_fetch_assoc($query)){
        
            $username  = $data['target']; # INPUT USERNAME TARGET HERE
            
            $useragent = 'Instagram 27.0.0.7.97 Android (18/4.3; 320dpi; 720x1280; Xiaomi; HM 1SW; armani; qcom; en_US)';
            $cookies   = 'ds_user=instamedia.co.id;shbid=155;shbts=1534506651.185972;rur=FTW;csrftoken=4QEAd8BJNSGTqwWsCsvkxQxaeHI7DOAh;mid=W3a2mgABAAGD9Er5fIbp7NT9Z73M;ds_user_id=7594907455;urlgen=\"{\\\"182.1.102.239\\\": 23693}:1fqdHH:HI8j_anm5-caDjyVAYsZx06rvPI\";sessionid=IGSC3fbd90b2c39f28944877b6acbfd5e7fff6fb05924cb2b66baa834c6d62552fc4%3AzT2Aco1apb0JpmVT8mRxVJHqQhYRpSab%3A%7B%22_auth_user_id%22%3A7594907455%2C%22_auth_user_backend%22%3A%22accounts.backends.CaseInsensitiveModelBackend%22%2C%22_auth_user_hash%22%3A%22%22%2C%22_platform%22%3A1%2C%22_token_ver%22%3A2%2C%22_token%22%3A%227594907455%3A2zgxLE6qYgzqkwSOs0u5PECU8ssWGUNQ%3A3afe52d6b3dbaf6acf732c272d9dc3f8a8bfeb6c90c2f5ef64d7769d0b112b76%22%2C%22last_refreshed%22%3A1534506651.1866247654%7D;mcd=3;'; # BISA DIGANTI PAKE COOKIES AKUN INSTAGRAM KALIAN, PAKE USERAGENT VERSION 27, KALO GA NGERTI DAPETINNYA BISA CHAT GW
            
            $getInfo = $this->request('https://i.instagram.com/api/v1/users/'.$username.'/usernameinfo/', $useragent, 0, $cookies);
            
            $getInfo = json_decode($getInfo[1]);

            print($getInfo);
            if($getInfo->user->is_private == true)
            {
                print 'Username '.$username.' Dalam Keadaan Private';
            }
            else
            {
                $userID = $getInfo->user->pk;
            }
            
            $userFeed = $this->request('https://i.instagram.com/api/v1/feed/user/'.$userID.'/', $useragent, 0, $cookies);
            $userFeed = json_decode($userFeed[1]);


            
            if($userFeed->status == 'ok')
            {
                
                $postUrl  = 'https://www.instagram.com/p/'.$userFeed->items[0]->code.'/';
                
                
                $cekpost = mysqli_query($con, "SELECT * FROM users_history WHERE target='".$postUrl."'");
                
                if(mysqli_num_rows($cekpost) == 0){
                    $ceklimit = DB::table('users_history')->whereDate('created_at', date('Y-m-d'))->where('type', 'Auto Like')->count();
                    
                    if($ceklimit <= 10){
                        $key = 'hgfghfghfgf657656756sadhghsadg';
                        $jml = 250;
                    
                        $this->proses2('https://103.52.147.51/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=2&quantity='.$jml);
                        $this->proses2('https://103.84.194.131/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=2&quantity='.$jml);
                        $this->proses2('https://103.252.100.74/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=2&quantity='.$jml);
                        $this->proses2('https://103.252.100.74/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=4&quantity='.$jml);
                        $uszz = "ivanz";
                    	$pws = "kntolz32";
                    	$result = $this->proses("http://167.99.202.150/kuy/bowokntolzx.php","urlxx={$postUrl}&jumlahlahx={$jml}",$uszz,$pws);
                    	$result = $this->proses("http://167.99.202.150/kuy/bowokntolzx.php","urlxx={$postUrl}&jumlahlahx={$jml}",$uszz,$pws);
                        
                        
                        $delay = 20;
                        
                        
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_4' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_1' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_6' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_5' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_7' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_8' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_9' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        
                        $history = new \App\History;
                        $history->submitted_by = $data['submitted_by'];
                        $history->target = $postUrl;
                        $history->type = 'Auto Like';
                        $history->total_submit = 1500;
                        
                        $history->ip = $_SERVER['REMOTE_ADDR'];
                        $history->save();
                    
                        echo '<p><span style="color:green">[SUKSES]</span>'.$postUrl.'</p>';
                    }
                }else{
                    echo '<p><span style="color:red">[GAGAL]</span>'.$postUrl.' Sudah di like!</p>';
                }
            }
            else
            {
                print 'Terjadi Kesalahan: '.$userFeed['message'];
            }
            
            sleep(10);
        }
        
    }
    
    public function cronauto4(){
        
        
        set_time_limit(10000);
        error_reporting(0);
        
        $con = mysqli_connect('localhost', 'instagr9_panel', '#=ZR0.ZZ.[x7', 'instagr9_panel');
        $query = mysqli_query($con, "SELECT * FROM auto LIMIT 10 OFFSET 40");
        while($data = mysqli_fetch_assoc($query)){
        
            $username  = $data['target']; # INPUT USERNAME TARGET HERE
            
            $useragent = 'Instagram 27.0.0.7.97 Android (18/4.3; 320dpi; 720x1280; Xiaomi; HM 1SW; armani; qcom; en_US)';
            $cookies   = 'ds_user=instamedia.co.id;shbid=155;shbts=1534506651.185972;rur=FTW;csrftoken=4QEAd8BJNSGTqwWsCsvkxQxaeHI7DOAh;mid=W3a2mgABAAGD9Er5fIbp7NT9Z73M;ds_user_id=7594907455;urlgen=\"{\\\"182.1.102.239\\\": 23693}:1fqdHH:HI8j_anm5-caDjyVAYsZx06rvPI\";sessionid=IGSC3fbd90b2c39f28944877b6acbfd5e7fff6fb05924cb2b66baa834c6d62552fc4%3AzT2Aco1apb0JpmVT8mRxVJHqQhYRpSab%3A%7B%22_auth_user_id%22%3A7594907455%2C%22_auth_user_backend%22%3A%22accounts.backends.CaseInsensitiveModelBackend%22%2C%22_auth_user_hash%22%3A%22%22%2C%22_platform%22%3A1%2C%22_token_ver%22%3A2%2C%22_token%22%3A%227594907455%3A2zgxLE6qYgzqkwSOs0u5PECU8ssWGUNQ%3A3afe52d6b3dbaf6acf732c272d9dc3f8a8bfeb6c90c2f5ef64d7769d0b112b76%22%2C%22last_refreshed%22%3A1534506651.1866247654%7D;mcd=3;'; # BISA DIGANTI PAKE COOKIES AKUN INSTAGRAM KALIAN, PAKE USERAGENT VERSION 27, KALO GA NGERTI DAPETINNYA BISA CHAT GW
            
            $getInfo = $this->request('https://i.instagram.com/api/v1/users/'.$username.'/usernameinfo/', $useragent, 0, $cookies);
            
            $getInfo = json_decode($getInfo[1]);

            print($getInfo);
            if($getInfo->user->is_private == true)
            {
                print 'Username '.$username.' Dalam Keadaan Private';
            }
            else
            {
                $userID = $getInfo->user->pk;
            }
            
            $userFeed = $this->request('https://i.instagram.com/api/v1/feed/user/'.$userID.'/', $useragent, 0, $cookies);
            $userFeed = json_decode($userFeed[1]);


            
            if($userFeed->status == 'ok')
            {
                
                $postUrl  = 'https://www.instagram.com/p/'.$userFeed->items[0]->code.'/';
                
                
                $cekpost = mysqli_query($con, "SELECT * FROM users_history WHERE target='".$postUrl."'");
                
                if(mysqli_num_rows($cekpost) == 0){
                    $ceklimit = DB::table('users_history')->whereDate('created_at', date('Y-m-d'))->where('type', 'Auto Like')->count();
                    
                    if($ceklimit <= 10){
                        $key = 'hgfghfghfgf657656756sadhghsadg';
                        $jml = 250;
                    
                        $this->proses2('https://103.52.147.51/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=2&quantity='.$jml);
                        $this->proses2('https://103.84.194.131/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=2&quantity='.$jml);
                        $this->proses2('https://103.252.100.74/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=2&quantity='.$jml);
                        $this->proses2('https://103.252.100.74/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=4&quantity='.$jml);
                        $uszz = "ivanz";
                    	$pws = "kntolz32";
                    	$result = $this->proses("http://167.99.202.150/kuy/bowokntolzx.php","urlxx={$postUrl}&jumlahlahx={$jml}",$uszz,$pws);
                    	$result = $this->proses("http://167.99.202.150/kuy/bowokntolzx.php","urlxx={$postUrl}&jumlahlahx={$jml}",$uszz,$pws);
                        
                        
                        $delay = 20;
                        
                        
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_4' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_1' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_6' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_5' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_7' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_8' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_9' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        
                        $history = new \App\History;
                        $history->submitted_by = $data['submitted_by'];
                        $history->target = $postUrl;
                        $history->type = 'Auto Like';
                        $history->total_submit = 1500;
                        
                        $history->ip = $_SERVER['REMOTE_ADDR'];
                        $history->save();
                    
                        echo '<p><span style="color:green">[SUKSES]</span>'.$postUrl.'</p>';
                    }
                }else{
                    echo '<p><span style="color:red">[GAGAL]</span>'.$postUrl.' Sudah di like!</p>';
                }
            }
            else
            {
                print 'Terjadi Kesalahan: '.$userFeed['message'];
            }
            
            sleep(10);
        }
        
    }
    
    public function cronauto5(){
        
        
        set_time_limit(10000);
        error_reporting(0);
        
        $con = mysqli_connect('localhost', 'instagr9_panel', '#=ZR0.ZZ.[x7', 'instagr9_panel');
        $query = mysqli_query($con, "SELECT * FROM auto LIMIT 10 OFFSET 50");
        while($data = mysqli_fetch_assoc($query)){
        
            $username  = $data['target']; # INPUT USERNAME TARGET HERE
            
            $useragent = 'Instagram 27.0.0.7.97 Android (18/4.3; 320dpi; 720x1280; Xiaomi; HM 1SW; armani; qcom; en_US)';
            $cookies   = 'ds_user=instamedia.co.id;shbid=155;shbts=1534506651.185972;rur=FTW;csrftoken=4QEAd8BJNSGTqwWsCsvkxQxaeHI7DOAh;mid=W3a2mgABAAGD9Er5fIbp7NT9Z73M;ds_user_id=7594907455;urlgen=\"{\\\"182.1.102.239\\\": 23693}:1fqdHH:HI8j_anm5-caDjyVAYsZx06rvPI\";sessionid=IGSC3fbd90b2c39f28944877b6acbfd5e7fff6fb05924cb2b66baa834c6d62552fc4%3AzT2Aco1apb0JpmVT8mRxVJHqQhYRpSab%3A%7B%22_auth_user_id%22%3A7594907455%2C%22_auth_user_backend%22%3A%22accounts.backends.CaseInsensitiveModelBackend%22%2C%22_auth_user_hash%22%3A%22%22%2C%22_platform%22%3A1%2C%22_token_ver%22%3A2%2C%22_token%22%3A%227594907455%3A2zgxLE6qYgzqkwSOs0u5PECU8ssWGUNQ%3A3afe52d6b3dbaf6acf732c272d9dc3f8a8bfeb6c90c2f5ef64d7769d0b112b76%22%2C%22last_refreshed%22%3A1534506651.1866247654%7D;mcd=3;'; # BISA DIGANTI PAKE COOKIES AKUN INSTAGRAM KALIAN, PAKE USERAGENT VERSION 27, KALO GA NGERTI DAPETINNYA BISA CHAT GW
            
            $getInfo = $this->request('https://i.instagram.com/api/v1/users/'.$username.'/usernameinfo/', $useragent, 0, $cookies);
            
            $getInfo = json_decode($getInfo[1]);

            print($getInfo);
            if($getInfo->user->is_private == true)
            {
                print 'Username '.$username.' Dalam Keadaan Private';
            }
            else
            {
                $userID = $getInfo->user->pk;
            }
            
            $userFeed = $this->request('https://i.instagram.com/api/v1/feed/user/'.$userID.'/', $useragent, 0, $cookies);
            $userFeed = json_decode($userFeed[1]);


            
            if($userFeed->status == 'ok')
            {
                
                $postUrl  = 'https://www.instagram.com/p/'.$userFeed->items[0]->code.'/';
                
                
                $cekpost = mysqli_query($con, "SELECT * FROM users_history WHERE target='".$postUrl."'");
                
                if(mysqli_num_rows($cekpost) == 0){
                    $ceklimit = DB::table('users_history')->whereDate('created_at', date('Y-m-d'))->where('type', 'Auto Like')->count();
                    
                    if($ceklimit <= 10){
                        $key = 'hgfghfghfgf657656756sadhghsadg';
                        $jml = 250;
                    
                        $this->proses2('https://103.52.147.51/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=2&quantity='.$jml);
                        $this->proses2('https://103.84.194.131/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=2&quantity='.$jml);
                        $this->proses2('https://103.252.100.74/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=2&quantity='.$jml);
                        $this->proses2('https://103.252.100.74/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=4&quantity='.$jml);
                        $uszz = "ivanz";
                    	$pws = "kntolz32";
                    	$result = $this->proses("http://167.99.202.150/kuy/bowokntolzx.php","urlxx={$postUrl}&jumlahlahx={$jml}",$uszz,$pws);
                    	$result = $this->proses("http://167.99.202.150/kuy/bowokntolzx.php","urlxx={$postUrl}&jumlahlahx={$jml}",$uszz,$pws);
                        
                        
                        $delay = 20;
                        
                        
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_4' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_1' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_6' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_5' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_7' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_8' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_9' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        
                        $history = new \App\History;
                        $history->submitted_by = $data['submitted_by'];
                        $history->target = $postUrl;
                        $history->type = 'Auto Like';
                        $history->total_submit = 1500;
                        
                        $history->ip = $_SERVER['REMOTE_ADDR'];
                        $history->save();
                    
                        echo '<p><span style="color:green">[SUKSES]</span>'.$postUrl.'</p>';
                    }
                }else{
                    echo '<p><span style="color:red">[GAGAL]</span>'.$postUrl.' Sudah di like!</p>';
                }
            }
            else
            {
                print 'Terjadi Kesalahan: '.$userFeed['message'];
            }
            
            sleep(10);
        }
        
    }
    
    public function cronauto6(){
        
        
        set_time_limit(10000);
        error_reporting(0);
        
        $con = mysqli_connect('localhost', 'instagr9_panel', '#=ZR0.ZZ.[x7', 'instagr9_panel');
        $query = mysqli_query($con, "SELECT * FROM auto LIMIT 10 OFFSET 60");
        while($data = mysqli_fetch_assoc($query)){
        
            $username  = $data['target']; # INPUT USERNAME TARGET HERE
            
            $useragent = 'Instagram 27.0.0.7.97 Android (18/4.3; 320dpi; 720x1280; Xiaomi; HM 1SW; armani; qcom; en_US)';
            $cookies   = 'ds_user=instamedia.co.id;shbid=155;shbts=1534506651.185972;rur=FTW;csrftoken=4QEAd8BJNSGTqwWsCsvkxQxaeHI7DOAh;mid=W3a2mgABAAGD9Er5fIbp7NT9Z73M;ds_user_id=7594907455;urlgen=\"{\\\"182.1.102.239\\\": 23693}:1fqdHH:HI8j_anm5-caDjyVAYsZx06rvPI\";sessionid=IGSC3fbd90b2c39f28944877b6acbfd5e7fff6fb05924cb2b66baa834c6d62552fc4%3AzT2Aco1apb0JpmVT8mRxVJHqQhYRpSab%3A%7B%22_auth_user_id%22%3A7594907455%2C%22_auth_user_backend%22%3A%22accounts.backends.CaseInsensitiveModelBackend%22%2C%22_auth_user_hash%22%3A%22%22%2C%22_platform%22%3A1%2C%22_token_ver%22%3A2%2C%22_token%22%3A%227594907455%3A2zgxLE6qYgzqkwSOs0u5PECU8ssWGUNQ%3A3afe52d6b3dbaf6acf732c272d9dc3f8a8bfeb6c90c2f5ef64d7769d0b112b76%22%2C%22last_refreshed%22%3A1534506651.1866247654%7D;mcd=3;'; # BISA DIGANTI PAKE COOKIES AKUN INSTAGRAM KALIAN, PAKE USERAGENT VERSION 27, KALO GA NGERTI DAPETINNYA BISA CHAT GW
            
            $getInfo = $this->request('https://i.instagram.com/api/v1/users/'.$username.'/usernameinfo/', $useragent, 0, $cookies);
            
            $getInfo = json_decode($getInfo[1]);

            print($getInfo);
            if($getInfo->user->is_private == true)
            {
                print 'Username '.$username.' Dalam Keadaan Private';
            }
            else
            {
                $userID = $getInfo->user->pk;
            }
            
            $userFeed = $this->request('https://i.instagram.com/api/v1/feed/user/'.$userID.'/', $useragent, 0, $cookies);
            $userFeed = json_decode($userFeed[1]);


            
            if($userFeed->status == 'ok')
            {
                
                $postUrl  = 'https://www.instagram.com/p/'.$userFeed->items[0]->code.'/';
                
                
                $cekpost = mysqli_query($con, "SELECT * FROM users_history WHERE target='".$postUrl."'");
                
                if(mysqli_num_rows($cekpost) == 0){
                    $ceklimit = DB::table('users_history')->whereDate('created_at', date('Y-m-d'))->where('type', 'Auto Like')->count();
                    
                    if($ceklimit <= 10){
                        $key = 'hgfghfghfgf657656756sadhghsadg';
                        $jml = 250;
                    
                        $this->proses2('https://103.52.147.51/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=2&quantity='.$jml);
                        $this->proses2('https://103.84.194.131/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=2&quantity='.$jml);
                        $this->proses2('https://103.252.100.74/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=2&quantity='.$jml);
                        $this->proses2('https://103.252.100.74/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=4&quantity='.$jml);
                        $uszz = "ivanz";
                    	$pws = "kntolz32";
                    	$result = $this->proses("http://167.99.202.150/kuy/bowokntolzx.php","urlxx={$postUrl}&jumlahlahx={$jml}",$uszz,$pws);
                    	$result = $this->proses("http://167.99.202.150/kuy/bowokntolzx.php","urlxx={$postUrl}&jumlahlahx={$jml}",$uszz,$pws);
                        
                        
                        $delay = 20;
                        
                        
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_4' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_1' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_6' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_5' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_7' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_8' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_9' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        
                        $history = new \App\History;
                        $history->submitted_by = $data['submitted_by'];
                        $history->target = $postUrl;
                        $history->type = 'Auto Like';
                        $history->total_submit = 1500;
                        
                        $history->ip = $_SERVER['REMOTE_ADDR'];
                        $history->save();
                    
                        echo '<p><span style="color:green">[SUKSES]</span>'.$postUrl.'</p>';
                    }
                }else{
                    echo '<p><span style="color:red">[GAGAL]</span>'.$postUrl.' Sudah di like!</p>';
                }
            }
            else
            {
                print 'Terjadi Kesalahan: '.$userFeed['message'];
            }
            
            sleep(10);
        }
        
    }
    
    public function cronauto7(){
        
        
        set_time_limit(10000);
        error_reporting(0);
        
        $con = mysqli_connect('localhost', 'instagr9_panel', '#=ZR0.ZZ.[x7', 'instagr9_panel');
        $query = mysqli_query($con, "SELECT * FROM auto LIMIT 10 OFFSET 70");
        while($data = mysqli_fetch_assoc($query)){
        
            $username  = $data['target']; # INPUT USERNAME TARGET HERE
            
            $useragent = 'Instagram 27.0.0.7.97 Android (18/4.3; 320dpi; 720x1280; Xiaomi; HM 1SW; armani; qcom; en_US)';
            $cookies   = 'ds_user=instamedia.co.id;shbid=155;shbts=1534506651.185972;rur=FTW;csrftoken=4QEAd8BJNSGTqwWsCsvkxQxaeHI7DOAh;mid=W3a2mgABAAGD9Er5fIbp7NT9Z73M;ds_user_id=7594907455;urlgen=\"{\\\"182.1.102.239\\\": 23693}:1fqdHH:HI8j_anm5-caDjyVAYsZx06rvPI\";sessionid=IGSC3fbd90b2c39f28944877b6acbfd5e7fff6fb05924cb2b66baa834c6d62552fc4%3AzT2Aco1apb0JpmVT8mRxVJHqQhYRpSab%3A%7B%22_auth_user_id%22%3A7594907455%2C%22_auth_user_backend%22%3A%22accounts.backends.CaseInsensitiveModelBackend%22%2C%22_auth_user_hash%22%3A%22%22%2C%22_platform%22%3A1%2C%22_token_ver%22%3A2%2C%22_token%22%3A%227594907455%3A2zgxLE6qYgzqkwSOs0u5PECU8ssWGUNQ%3A3afe52d6b3dbaf6acf732c272d9dc3f8a8bfeb6c90c2f5ef64d7769d0b112b76%22%2C%22last_refreshed%22%3A1534506651.1866247654%7D;mcd=3;'; # BISA DIGANTI PAKE COOKIES AKUN INSTAGRAM KALIAN, PAKE USERAGENT VERSION 27, KALO GA NGERTI DAPETINNYA BISA CHAT GW
            
            $getInfo = $this->request('https://i.instagram.com/api/v1/users/'.$username.'/usernameinfo/', $useragent, 0, $cookies);
            
            $getInfo = json_decode($getInfo[1]);

            print($getInfo);
            if($getInfo->user->is_private == true)
            {
                print 'Username '.$username.' Dalam Keadaan Private';
            }
            else
            {
                $userID = $getInfo->user->pk;
            }
            
            $userFeed = $this->request('https://i.instagram.com/api/v1/feed/user/'.$userID.'/', $useragent, 0, $cookies);
            $userFeed = json_decode($userFeed[1]);


            
            if($userFeed->status == 'ok')
            {
                
                $postUrl  = 'https://www.instagram.com/p/'.$userFeed->items[0]->code.'/';
                
                
                $cekpost = mysqli_query($con, "SELECT * FROM users_history WHERE target='".$postUrl."'");
                
                if(mysqli_num_rows($cekpost) == 0){
                    $ceklimit = DB::table('users_history')->whereDate('created_at', date('Y-m-d'))->where('type', 'Auto Like')->count();
                    
                    if($ceklimit <= 10){
                        $key = 'hgfghfghfgf657656756sadhghsadg';
                        $jml = 250;
                    
                        $this->proses2('https://103.52.147.51/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=2&quantity='.$jml);
                        $this->proses2('https://103.84.194.131/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=2&quantity='.$jml);
                        $this->proses2('https://103.252.100.74/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=2&quantity='.$jml);
                        $this->proses2('https://103.252.100.74/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=4&quantity='.$jml);
                        $uszz = "ivanz";
                    	$pws = "kntolz32";
                    	$result = $this->proses("http://167.99.202.150/kuy/bowokntolzx.php","urlxx={$postUrl}&jumlahlahx={$jml}",$uszz,$pws);
                    	$result = $this->proses("http://167.99.202.150/kuy/bowokntolzx.php","urlxx={$postUrl}&jumlahlahx={$jml}",$uszz,$pws);
                        
                        
                        $delay = 20;
                        
                        
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_4' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_1' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_6' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_5' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_7' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_8' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_9' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        
                        $history = new \App\History;
                        $history->submitted_by = $data['submitted_by'];
                        $history->target = $postUrl;
                        $history->type = 'Auto Like';
                        $history->total_submit = 1500;
                        
                        $history->ip = $_SERVER['REMOTE_ADDR'];
                        $history->save();
                    
                        echo '<p><span style="color:green">[SUKSES]</span>'.$postUrl.'</p>';
                    }
                }else{
                    echo '<p><span style="color:red">[GAGAL]</span>'.$postUrl.' Sudah di like!</p>';
                }
            }
            else
            {
                print 'Terjadi Kesalahan: '.$userFeed['message'];
            }
            
            sleep(10);
        }
        
    }
    
    public function cronauto8(){
        
        
        set_time_limit(10000);
        error_reporting(0);
        
        $con = mysqli_connect('localhost', 'instagr9_panel', '#=ZR0.ZZ.[x7', 'instagr9_panel');
        $query = mysqli_query($con, "SELECT * FROM auto LIMIT 10 OFFSET 80");
        while($data = mysqli_fetch_assoc($query)){
        
            $username  = $data['target']; # INPUT USERNAME TARGET HERE
            
            $useragent = 'Instagram 27.0.0.7.97 Android (18/4.3; 320dpi; 720x1280; Xiaomi; HM 1SW; armani; qcom; en_US)';
            $cookies   = 'ds_user=instamedia.co.id;shbid=155;shbts=1534506651.185972;rur=FTW;csrftoken=4QEAd8BJNSGTqwWsCsvkxQxaeHI7DOAh;mid=W3a2mgABAAGD9Er5fIbp7NT9Z73M;ds_user_id=7594907455;urlgen=\"{\\\"182.1.102.239\\\": 23693}:1fqdHH:HI8j_anm5-caDjyVAYsZx06rvPI\";sessionid=IGSC3fbd90b2c39f28944877b6acbfd5e7fff6fb05924cb2b66baa834c6d62552fc4%3AzT2Aco1apb0JpmVT8mRxVJHqQhYRpSab%3A%7B%22_auth_user_id%22%3A7594907455%2C%22_auth_user_backend%22%3A%22accounts.backends.CaseInsensitiveModelBackend%22%2C%22_auth_user_hash%22%3A%22%22%2C%22_platform%22%3A1%2C%22_token_ver%22%3A2%2C%22_token%22%3A%227594907455%3A2zgxLE6qYgzqkwSOs0u5PECU8ssWGUNQ%3A3afe52d6b3dbaf6acf732c272d9dc3f8a8bfeb6c90c2f5ef64d7769d0b112b76%22%2C%22last_refreshed%22%3A1534506651.1866247654%7D;mcd=3;'; # BISA DIGANTI PAKE COOKIES AKUN INSTAGRAM KALIAN, PAKE USERAGENT VERSION 27, KALO GA NGERTI DAPETINNYA BISA CHAT GW
            
            $getInfo = $this->request('https://i.instagram.com/api/v1/users/'.$username.'/usernameinfo/', $useragent, 0, $cookies);
            
            $getInfo = json_decode($getInfo[1]);

            print($getInfo);
            if($getInfo->user->is_private == true)
            {
                print 'Username '.$username.' Dalam Keadaan Private';
            }
            else
            {
                $userID = $getInfo->user->pk;
            }
            
            $userFeed = $this->request('https://i.instagram.com/api/v1/feed/user/'.$userID.'/', $useragent, 0, $cookies);
            $userFeed = json_decode($userFeed[1]);


            
            if($userFeed->status == 'ok')
            {
                
                $postUrl  = 'https://www.instagram.com/p/'.$userFeed->items[0]->code.'/';
                
                
                $cekpost = mysqli_query($con, "SELECT * FROM users_history WHERE target='".$postUrl."'");
                
                if(mysqli_num_rows($cekpost) == 0){
                    $ceklimit = DB::table('users_history')->whereDate('created_at', date('Y-m-d'))->where('type', 'Auto Like')->count();
                    
                    if($ceklimit <= 10){
                        $key = 'hgfghfghfgf657656756sadhghsadg';
                        $jml = 250;
                    
                        $this->proses2('https://103.52.147.51/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=2&quantity='.$jml);
                        $this->proses2('https://103.84.194.131/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=2&quantity='.$jml);
                        $this->proses2('https://103.252.100.74/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=2&quantity='.$jml);
                        $this->proses2('https://103.252.100.74/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=4&quantity='.$jml);
                        $uszz = "ivanz";
                    	$pws = "kntolz32";
                    	$result = $this->proses("http://167.99.202.150/kuy/bowokntolzx.php","urlxx={$postUrl}&jumlahlahx={$jml}",$uszz,$pws);
                    	$result = $this->proses("http://167.99.202.150/kuy/bowokntolzx.php","urlxx={$postUrl}&jumlahlahx={$jml}",$uszz,$pws);
                        
                        
                        $delay = 20;
                        
                        
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_4' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_1' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_6' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_5' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_7' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_8' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_9' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        
                        $history = new \App\History;
                        $history->submitted_by = $data['submitted_by'];
                        $history->target = $postUrl;
                        $history->type = 'Auto Like';
                        $history->total_submit = 1500;
                        
                        $history->ip = $_SERVER['REMOTE_ADDR'];
                        $history->save();
                    
                        echo '<p><span style="color:green">[SUKSES]</span>'.$postUrl.'</p>';
                    }
                }else{
                    echo '<p><span style="color:red">[GAGAL]</span>'.$postUrl.' Sudah di like!</p>';
                }
            }
            else
            {
                print 'Terjadi Kesalahan: '.$userFeed['message'];
            }
            
            sleep(10);
        }
        
    }
    
    public function cronauto9(){
        
        
        set_time_limit(10000);
        error_reporting(0);
        
        $con = mysqli_connect('localhost', 'instagr9_panel', '#=ZR0.ZZ.[x7', 'instagr9_panel');
        $query = mysqli_query($con, "SELECT * FROM auto LIMIT 10 OFFSET 90");
        while($data = mysqli_fetch_assoc($query)){
        
            $username  = $data['target']; # INPUT USERNAME TARGET HERE
            
            $useragent = 'Instagram 27.0.0.7.97 Android (18/4.3; 320dpi; 720x1280; Xiaomi; HM 1SW; armani; qcom; en_US)';
            $cookies   = 'ds_user=instamedia.co.id;shbid=155;shbts=1534506651.185972;rur=FTW;csrftoken=4QEAd8BJNSGTqwWsCsvkxQxaeHI7DOAh;mid=W3a2mgABAAGD9Er5fIbp7NT9Z73M;ds_user_id=7594907455;urlgen=\"{\\\"182.1.102.239\\\": 23693}:1fqdHH:HI8j_anm5-caDjyVAYsZx06rvPI\";sessionid=IGSC3fbd90b2c39f28944877b6acbfd5e7fff6fb05924cb2b66baa834c6d62552fc4%3AzT2Aco1apb0JpmVT8mRxVJHqQhYRpSab%3A%7B%22_auth_user_id%22%3A7594907455%2C%22_auth_user_backend%22%3A%22accounts.backends.CaseInsensitiveModelBackend%22%2C%22_auth_user_hash%22%3A%22%22%2C%22_platform%22%3A1%2C%22_token_ver%22%3A2%2C%22_token%22%3A%227594907455%3A2zgxLE6qYgzqkwSOs0u5PECU8ssWGUNQ%3A3afe52d6b3dbaf6acf732c272d9dc3f8a8bfeb6c90c2f5ef64d7769d0b112b76%22%2C%22last_refreshed%22%3A1534506651.1866247654%7D;mcd=3;'; # BISA DIGANTI PAKE COOKIES AKUN INSTAGRAM KALIAN, PAKE USERAGENT VERSION 27, KALO GA NGERTI DAPETINNYA BISA CHAT GW
            
            $getInfo = $this->request('https://i.instagram.com/api/v1/users/'.$username.'/usernameinfo/', $useragent, 0, $cookies);
            
            $getInfo = json_decode($getInfo[1]);

            print($getInfo);
            if($getInfo->user->is_private == true)
            {
                print 'Username '.$username.' Dalam Keadaan Private';
            }
            else
            {
                $userID = $getInfo->user->pk;
            }
            
            $userFeed = $this->request('https://i.instagram.com/api/v1/feed/user/'.$userID.'/', $useragent, 0, $cookies);
            $userFeed = json_decode($userFeed[1]);


            
            if($userFeed->status == 'ok')
            {
                
                $postUrl  = 'https://www.instagram.com/p/'.$userFeed->items[0]->code.'/';
                
                
                $cekpost = mysqli_query($con, "SELECT * FROM users_history WHERE target='".$postUrl."'");
                
                if(mysqli_num_rows($cekpost) == 0){
                    $ceklimit = DB::table('users_history')->whereDate('created_at', date('Y-m-d'))->where('type', 'Auto Like')->count();
                    
                    if($ceklimit <= 10){
                        $key = 'hgfghfghfgf657656756sadhghsadg';
                        $jml = 250;
                    
                        $this->proses2('https://103.52.147.51/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=2&quantity='.$jml);
                        $this->proses2('https://103.84.194.131/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=2&quantity='.$jml);
                        $this->proses2('https://103.252.100.74/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=2&quantity='.$jml);
                        $this->proses2('https://103.252.100.74/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=4&quantity='.$jml);
                        $uszz = "ivanz";
                    	$pws = "kntolz32";
                    	$result = $this->proses("http://167.99.202.150/kuy/bowokntolzx.php","urlxx={$postUrl}&jumlahlahx={$jml}",$uszz,$pws);
                    	$result = $this->proses("http://167.99.202.150/kuy/bowokntolzx.php","urlxx={$postUrl}&jumlahlahx={$jml}",$uszz,$pws);
                        
                        
                        $delay = 20;
                        
                        
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_4' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_1' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_6' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_5' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_7' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_8' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_9' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        
                        $history = new \App\History;
                        $history->submitted_by = $data['submitted_by'];
                        $history->target = $postUrl;
                        $history->type = 'Auto Like';
                        $history->total_submit = 1500;
                        
                        $history->ip = $_SERVER['REMOTE_ADDR'];
                        $history->save();
                    
                        echo '<p><span style="color:green">[SUKSES]</span>'.$postUrl.'</p>';
                    }
                }else{
                    echo '<p><span style="color:red">[GAGAL]</span>'.$postUrl.' Sudah di like!</p>';
                }
            }
            else
            {
                print 'Terjadi Kesalahan: '.$userFeed['message'];
            }
            
            sleep(10);
        }
        
    }
    
    public function cronauto10(){
        
        
        set_time_limit(10000);
        error_reporting(0);
        
        $con = mysqli_connect('localhost', 'instagr9_panel', '#=ZR0.ZZ.[x7', 'instagr9_panel');
        $query = mysqli_query($con, "SELECT * FROM auto LIMIT 10 OFFSET 100");
        while($data = mysqli_fetch_assoc($query)){
        
            $username  = $data['target']; # INPUT USERNAME TARGET HERE
            
            $useragent = 'Instagram 27.0.0.7.97 Android (18/4.3; 320dpi; 720x1280; Xiaomi; HM 1SW; armani; qcom; en_US)';
            $cookies   = 'ds_user=instamedia.co.id;shbid=155;shbts=1534506651.185972;rur=FTW;csrftoken=4QEAd8BJNSGTqwWsCsvkxQxaeHI7DOAh;mid=W3a2mgABAAGD9Er5fIbp7NT9Z73M;ds_user_id=7594907455;urlgen=\"{\\\"182.1.102.239\\\": 23693}:1fqdHH:HI8j_anm5-caDjyVAYsZx06rvPI\";sessionid=IGSC3fbd90b2c39f28944877b6acbfd5e7fff6fb05924cb2b66baa834c6d62552fc4%3AzT2Aco1apb0JpmVT8mRxVJHqQhYRpSab%3A%7B%22_auth_user_id%22%3A7594907455%2C%22_auth_user_backend%22%3A%22accounts.backends.CaseInsensitiveModelBackend%22%2C%22_auth_user_hash%22%3A%22%22%2C%22_platform%22%3A1%2C%22_token_ver%22%3A2%2C%22_token%22%3A%227594907455%3A2zgxLE6qYgzqkwSOs0u5PECU8ssWGUNQ%3A3afe52d6b3dbaf6acf732c272d9dc3f8a8bfeb6c90c2f5ef64d7769d0b112b76%22%2C%22last_refreshed%22%3A1534506651.1866247654%7D;mcd=3;'; # BISA DIGANTI PAKE COOKIES AKUN INSTAGRAM KALIAN, PAKE USERAGENT VERSION 27, KALO GA NGERTI DAPETINNYA BISA CHAT GW
            
            $getInfo = $this->request('https://i.instagram.com/api/v1/users/'.$username.'/usernameinfo/', $useragent, 0, $cookies);
            
            $getInfo = json_decode($getInfo[1]);

            print($getInfo);
            if($getInfo->user->is_private == true)
            {
                print 'Username '.$username.' Dalam Keadaan Private';
            }
            else
            {
                $userID = $getInfo->user->pk;
            }
            
            $userFeed = $this->request('https://i.instagram.com/api/v1/feed/user/'.$userID.'/', $useragent, 0, $cookies);
            $userFeed = json_decode($userFeed[1]);


            
            if($userFeed->status == 'ok')
            {
                
                $postUrl  = 'https://www.instagram.com/p/'.$userFeed->items[0]->code.'/';
                
                
                $cekpost = mysqli_query($con, "SELECT * FROM users_history WHERE target='".$postUrl."'");
                
                if(mysqli_num_rows($cekpost) == 0){
                    $ceklimit = DB::table('users_history')->whereDate('created_at', date('Y-m-d'))->where('type', 'Auto Like')->count();
                    
                    if($ceklimit <= 10){
                        $key = 'hgfghfghfgf657656756sadhghsadg';
                        $jml = 250;
                    
                        $this->proses2('https://103.52.147.51/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=2&quantity='.$jml);
                        $this->proses2('https://103.84.194.131/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=2&quantity='.$jml);
                        $this->proses2('https://103.252.100.74/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=2&quantity='.$jml);
                        $this->proses2('https://103.252.100.74/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=4&quantity='.$jml);
                        $uszz = "ivanz";
                    	$pws = "kntolz32";
                    	$result = $this->proses("http://167.99.202.150/kuy/bowokntolzx.php","urlxx={$postUrl}&jumlahlahx={$jml}",$uszz,$pws);
                    	$result = $this->proses("http://167.99.202.150/kuy/bowokntolzx.php","urlxx={$postUrl}&jumlahlahx={$jml}",$uszz,$pws);
                        
                        
                        $delay = 20;
                        
                        
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_4' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_1' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_6' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_5' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_7' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_8' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_9' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        
                        $history = new \App\History;
                        $history->submitted_by = $data['submitted_by'];
                        $history->target = $postUrl;
                        $history->type = 'Auto Like';
                        $history->total_submit = 1500;
                        
                        $history->ip = $_SERVER['REMOTE_ADDR'];
                        $history->save();
                    
                        echo '<p><span style="color:green">[SUKSES]</span>'.$postUrl.'</p>';
                    }
                }else{
                    echo '<p><span style="color:red">[GAGAL]</span>'.$postUrl.' Sudah di like!</p>';
                }
            }
            else
            {
                print 'Terjadi Kesalahan: '.$userFeed['message'];
            }
            
            sleep(10);
        }
        
    }
    
    public function cronauto11(){
        
        
        set_time_limit(10000);
        error_reporting(0);
        
        $con = mysqli_connect('localhost', 'instagr9_panel', '#=ZR0.ZZ.[x7', 'instagr9_panel');
        $query = mysqli_query($con, "SELECT * FROM auto LIMIT 10 OFFSET 110");
        while($data = mysqli_fetch_assoc($query)){
        
            $username  = $data['target']; # INPUT USERNAME TARGET HERE
            
            $useragent = 'Instagram 27.0.0.7.97 Android (18/4.3; 320dpi; 720x1280; Xiaomi; HM 1SW; armani; qcom; en_US)';
            $cookies   = 'ds_user=instamedia.co.id;shbid=155;shbts=1534506651.185972;rur=FTW;csrftoken=4QEAd8BJNSGTqwWsCsvkxQxaeHI7DOAh;mid=W3a2mgABAAGD9Er5fIbp7NT9Z73M;ds_user_id=7594907455;urlgen=\"{\\\"182.1.102.239\\\": 23693}:1fqdHH:HI8j_anm5-caDjyVAYsZx06rvPI\";sessionid=IGSC3fbd90b2c39f28944877b6acbfd5e7fff6fb05924cb2b66baa834c6d62552fc4%3AzT2Aco1apb0JpmVT8mRxVJHqQhYRpSab%3A%7B%22_auth_user_id%22%3A7594907455%2C%22_auth_user_backend%22%3A%22accounts.backends.CaseInsensitiveModelBackend%22%2C%22_auth_user_hash%22%3A%22%22%2C%22_platform%22%3A1%2C%22_token_ver%22%3A2%2C%22_token%22%3A%227594907455%3A2zgxLE6qYgzqkwSOs0u5PECU8ssWGUNQ%3A3afe52d6b3dbaf6acf732c272d9dc3f8a8bfeb6c90c2f5ef64d7769d0b112b76%22%2C%22last_refreshed%22%3A1534506651.1866247654%7D;mcd=3;'; # BISA DIGANTI PAKE COOKIES AKUN INSTAGRAM KALIAN, PAKE USERAGENT VERSION 27, KALO GA NGERTI DAPETINNYA BISA CHAT GW
            
            $getInfo = $this->request('https://i.instagram.com/api/v1/users/'.$username.'/usernameinfo/', $useragent, 0, $cookies);
            
            $getInfo = json_decode($getInfo[1]);

            print($getInfo);
            if($getInfo->user->is_private == true)
            {
                print 'Username '.$username.' Dalam Keadaan Private';
            }
            else
            {
                $userID = $getInfo->user->pk;
            }
            
            $userFeed = $this->request('https://i.instagram.com/api/v1/feed/user/'.$userID.'/', $useragent, 0, $cookies);
            $userFeed = json_decode($userFeed[1]);


            
            if($userFeed->status == 'ok')
            {
                
                $postUrl  = 'https://www.instagram.com/p/'.$userFeed->items[0]->code.'/';
                
                
                $cekpost = mysqli_query($con, "SELECT * FROM users_history WHERE target='".$postUrl."'");
                
                if(mysqli_num_rows($cekpost) == 0){
                    $ceklimit = DB::table('users_history')->whereDate('created_at', date('Y-m-d'))->where('type', 'Auto Like')->count();
                    
                    if($ceklimit <= 10){
                        $key = 'hgfghfghfgf657656756sadhghsadg';
                        $jml = 250;
                    
                        $this->proses2('https://103.52.147.51/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=2&quantity='.$jml);
                        $this->proses2('https://103.84.194.131/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=2&quantity='.$jml);
                        $this->proses2('https://103.252.100.74/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=2&quantity='.$jml);
                        $this->proses2('https://103.252.100.74/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=4&quantity='.$jml);
                        $uszz = "ivanz";
                    	$pws = "kntolz32";
                    	$result = $this->proses("http://167.99.202.150/kuy/bowokntolzx.php","urlxx={$postUrl}&jumlahlahx={$jml}",$uszz,$pws);
                    	$result = $this->proses("http://167.99.202.150/kuy/bowokntolzx.php","urlxx={$postUrl}&jumlahlahx={$jml}",$uszz,$pws);
                        
                        
                        $delay = 20;
                        
                        
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_4' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_1' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_6' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_5' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_7' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_8' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_9' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        
                        $history = new \App\History;
                        $history->submitted_by = $data['submitted_by'];
                        $history->target = $postUrl;
                        $history->type = 'Auto Like';
                        $history->total_submit = 1500;
                        
                        $history->ip = $_SERVER['REMOTE_ADDR'];
                        $history->save();
                    
                        echo '<p><span style="color:green">[SUKSES]</span>'.$postUrl.'</p>';
                    }
                }else{
                    echo '<p><span style="color:red">[GAGAL]</span>'.$postUrl.' Sudah di like!</p>';
                }
            }
            else
            {
                print 'Terjadi Kesalahan: '.$userFeed['message'];
            }
            
            sleep(10);
        }
        
    }
    
    public function cronauto12(){
        
        
        set_time_limit(10000);
        error_reporting(0);
        
        $con = mysqli_connect('localhost', 'instagr9_panel', '#=ZR0.ZZ.[x7', 'instagr9_panel');
        $query = mysqli_query($con, "SELECT * FROM auto LIMIT 10 OFFSET 120");
        while($data = mysqli_fetch_assoc($query)){
        
            $username  = $data['target']; # INPUT USERNAME TARGET HERE
            
            $useragent = 'Instagram 27.0.0.7.97 Android (18/4.3; 320dpi; 720x1280; Xiaomi; HM 1SW; armani; qcom; en_US)';
            $cookies   = 'ds_user=instamedia.co.id;shbid=155;shbts=1534506651.185972;rur=FTW;csrftoken=4QEAd8BJNSGTqwWsCsvkxQxaeHI7DOAh;mid=W3a2mgABAAGD9Er5fIbp7NT9Z73M;ds_user_id=7594907455;urlgen=\"{\\\"182.1.102.239\\\": 23693}:1fqdHH:HI8j_anm5-caDjyVAYsZx06rvPI\";sessionid=IGSC3fbd90b2c39f28944877b6acbfd5e7fff6fb05924cb2b66baa834c6d62552fc4%3AzT2Aco1apb0JpmVT8mRxVJHqQhYRpSab%3A%7B%22_auth_user_id%22%3A7594907455%2C%22_auth_user_backend%22%3A%22accounts.backends.CaseInsensitiveModelBackend%22%2C%22_auth_user_hash%22%3A%22%22%2C%22_platform%22%3A1%2C%22_token_ver%22%3A2%2C%22_token%22%3A%227594907455%3A2zgxLE6qYgzqkwSOs0u5PECU8ssWGUNQ%3A3afe52d6b3dbaf6acf732c272d9dc3f8a8bfeb6c90c2f5ef64d7769d0b112b76%22%2C%22last_refreshed%22%3A1534506651.1866247654%7D;mcd=3;'; # BISA DIGANTI PAKE COOKIES AKUN INSTAGRAM KALIAN, PAKE USERAGENT VERSION 27, KALO GA NGERTI DAPETINNYA BISA CHAT GW
            
            $getInfo = $this->request('https://i.instagram.com/api/v1/users/'.$username.'/usernameinfo/', $useragent, 0, $cookies);
            
            $getInfo = json_decode($getInfo[1]);

            print($getInfo);
            if($getInfo->user->is_private == true)
            {
                print 'Username '.$username.' Dalam Keadaan Private';
            }
            else
            {
                $userID = $getInfo->user->pk;
            }
            
            $userFeed = $this->request('https://i.instagram.com/api/v1/feed/user/'.$userID.'/', $useragent, 0, $cookies);
            $userFeed = json_decode($userFeed[1]);


            
            if($userFeed->status == 'ok')
            {
                
                $postUrl  = 'https://www.instagram.com/p/'.$userFeed->items[0]->code.'/';
                
                
                $cekpost = mysqli_query($con, "SELECT * FROM users_history WHERE target='".$postUrl."'");
                
                if(mysqli_num_rows($cekpost) == 0){
                    $ceklimit = DB::table('users_history')->whereDate('created_at', date('Y-m-d'))->where('type', 'Auto Like')->count();
                    
                    if($ceklimit <= 10){
                        $key = 'hgfghfghfgf657656756sadhghsadg';
                        $jml = 250;
                    
                        $this->proses2('https://103.52.147.51/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=2&quantity='.$jml);
                        $this->proses2('https://103.84.194.131/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=2&quantity='.$jml);
                        $this->proses2('https://103.252.100.74/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=2&quantity='.$jml);
                        $this->proses2('https://103.252.100.74/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=4&quantity='.$jml);
                        $uszz = "ivanz";
                    	$pws = "kntolz32";
                    	$result = $this->proses("http://167.99.202.150/kuy/bowokntolzx.php","urlxx={$postUrl}&jumlahlahx={$jml}",$uszz,$pws);
                    	$result = $this->proses("http://167.99.202.150/kuy/bowokntolzx.php","urlxx={$postUrl}&jumlahlahx={$jml}",$uszz,$pws);
                        
                        
                        $delay = 20;
                        
                        
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_4' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_1' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_6' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_5' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_7' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_8' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_9' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        
                        $history = new \App\History;
                        $history->submitted_by = $data['submitted_by'];
                        $history->target = $postUrl;
                        $history->type = 'Auto Like';
                        $history->total_submit = 1500;
                        
                        $history->ip = $_SERVER['REMOTE_ADDR'];
                        $history->save();
                    
                        echo '<p><span style="color:green">[SUKSES]</span>'.$postUrl.'</p>';
                    }
                }else{
                    echo '<p><span style="color:red">[GAGAL]</span>'.$postUrl.' Sudah di like!</p>';
                }
            }
            else
            {
                print 'Terjadi Kesalahan: '.$userFeed['message'];
            }
            
            sleep(10);
        }
        
    }
    
    public function cronauto13(){
        
        
        set_time_limit(10000);
        error_reporting(0);
        
        $con = mysqli_connect('localhost', 'instagr9_panel', '#=ZR0.ZZ.[x7', 'instagr9_panel');
        $query = mysqli_query($con, "SELECT * FROM auto LIMIT 10 OFFSET 130");
        while($data = mysqli_fetch_assoc($query)){
        
            $username  = $data['target']; # INPUT USERNAME TARGET HERE
            
            $useragent = 'Instagram 27.0.0.7.97 Android (18/4.3; 320dpi; 720x1280; Xiaomi; HM 1SW; armani; qcom; en_US)';
            $cookies   = 'ds_user=instamedia.co.id;shbid=155;shbts=1534506651.185972;rur=FTW;csrftoken=4QEAd8BJNSGTqwWsCsvkxQxaeHI7DOAh;mid=W3a2mgABAAGD9Er5fIbp7NT9Z73M;ds_user_id=7594907455;urlgen=\"{\\\"182.1.102.239\\\": 23693}:1fqdHH:HI8j_anm5-caDjyVAYsZx06rvPI\";sessionid=IGSC3fbd90b2c39f28944877b6acbfd5e7fff6fb05924cb2b66baa834c6d62552fc4%3AzT2Aco1apb0JpmVT8mRxVJHqQhYRpSab%3A%7B%22_auth_user_id%22%3A7594907455%2C%22_auth_user_backend%22%3A%22accounts.backends.CaseInsensitiveModelBackend%22%2C%22_auth_user_hash%22%3A%22%22%2C%22_platform%22%3A1%2C%22_token_ver%22%3A2%2C%22_token%22%3A%227594907455%3A2zgxLE6qYgzqkwSOs0u5PECU8ssWGUNQ%3A3afe52d6b3dbaf6acf732c272d9dc3f8a8bfeb6c90c2f5ef64d7769d0b112b76%22%2C%22last_refreshed%22%3A1534506651.1866247654%7D;mcd=3;'; # BISA DIGANTI PAKE COOKIES AKUN INSTAGRAM KALIAN, PAKE USERAGENT VERSION 27, KALO GA NGERTI DAPETINNYA BISA CHAT GW
            
            $getInfo = $this->request('https://i.instagram.com/api/v1/users/'.$username.'/usernameinfo/', $useragent, 0, $cookies);
            
            $getInfo = json_decode($getInfo[1]);

            print($getInfo);
            if($getInfo->user->is_private == true)
            {
                print 'Username '.$username.' Dalam Keadaan Private';
            }
            else
            {
                $userID = $getInfo->user->pk;
            }
            
            $userFeed = $this->request('https://i.instagram.com/api/v1/feed/user/'.$userID.'/', $useragent, 0, $cookies);
            $userFeed = json_decode($userFeed[1]);


            
            if($userFeed->status == 'ok')
            {
                
                $postUrl  = 'https://www.instagram.com/p/'.$userFeed->items[0]->code.'/';
                
                
                $cekpost = mysqli_query($con, "SELECT * FROM users_history WHERE target='".$postUrl."'");
                
                if(mysqli_num_rows($cekpost) == 0){
                    $ceklimit = DB::table('users_history')->whereDate('created_at', date('Y-m-d'))->where('type', 'Auto Like')->count();
                    
                    if($ceklimit <= 10){
                        $key = 'hgfghfghfgf657656756sadhghsadg';
                        $jml = 250;
                    
                        $this->proses2('https://103.52.147.51/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=2&quantity='.$jml);
                        $this->proses2('https://103.84.194.131/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=2&quantity='.$jml);
                        $this->proses2('https://103.252.100.74/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=2&quantity='.$jml);
                        $this->proses2('https://103.252.100.74/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=4&quantity='.$jml);
                        $uszz = "ivanz";
                    	$pws = "kntolz32";
                    	$result = $this->proses("http://167.99.202.150/kuy/bowokntolzx.php","urlxx={$postUrl}&jumlahlahx={$jml}",$uszz,$pws);
                    	$result = $this->proses("http://167.99.202.150/kuy/bowokntolzx.php","urlxx={$postUrl}&jumlahlahx={$jml}",$uszz,$pws);
                        
                        
                        $delay = 20;
                        
                        
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_4' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_1' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_6' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_5' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_7' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_8' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_9' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        
                        $history = new \App\History;
                        $history->submitted_by = $data['submitted_by'];
                        $history->target = $postUrl;
                        $history->type = 'Auto Like';
                        $history->total_submit = 1500;
                        
                        $history->ip = $_SERVER['REMOTE_ADDR'];
                        $history->save();
                    
                        echo '<p><span style="color:green">[SUKSES]</span>'.$postUrl.'</p>';
                    }
                }else{
                    echo '<p><span style="color:red">[GAGAL]</span>'.$postUrl.' Sudah di like!</p>';
                }
            }
            else
            {
                print 'Terjadi Kesalahan: '.$userFeed['message'];
            }
            
            sleep(10);
        }
        
    }
    
    
    public function cronauto14(){
        
        
        set_time_limit(10000);
        error_reporting(0);
        
        $con = mysqli_connect('localhost', 'instagr9_panel', '#=ZR0.ZZ.[x7', 'instagr9_panel');
        $query = mysqli_query($con, "SELECT * FROM auto LIMIT 10 OFFSET 140");
        while($data = mysqli_fetch_assoc($query)){
        
            $username  = $data['target']; # INPUT USERNAME TARGET HERE
            
            $useragent = 'Instagram 27.0.0.7.97 Android (18/4.3; 320dpi; 720x1280; Xiaomi; HM 1SW; armani; qcom; en_US)';
            $cookies   = 'ds_user=instamedia.co.id;shbid=155;shbts=1534506651.185972;rur=FTW;csrftoken=4QEAd8BJNSGTqwWsCsvkxQxaeHI7DOAh;mid=W3a2mgABAAGD9Er5fIbp7NT9Z73M;ds_user_id=7594907455;urlgen=\"{\\\"182.1.102.239\\\": 23693}:1fqdHH:HI8j_anm5-caDjyVAYsZx06rvPI\";sessionid=IGSC3fbd90b2c39f28944877b6acbfd5e7fff6fb05924cb2b66baa834c6d62552fc4%3AzT2Aco1apb0JpmVT8mRxVJHqQhYRpSab%3A%7B%22_auth_user_id%22%3A7594907455%2C%22_auth_user_backend%22%3A%22accounts.backends.CaseInsensitiveModelBackend%22%2C%22_auth_user_hash%22%3A%22%22%2C%22_platform%22%3A1%2C%22_token_ver%22%3A2%2C%22_token%22%3A%227594907455%3A2zgxLE6qYgzqkwSOs0u5PECU8ssWGUNQ%3A3afe52d6b3dbaf6acf732c272d9dc3f8a8bfeb6c90c2f5ef64d7769d0b112b76%22%2C%22last_refreshed%22%3A1534506651.1866247654%7D;mcd=3;'; # BISA DIGANTI PAKE COOKIES AKUN INSTAGRAM KALIAN, PAKE USERAGENT VERSION 27, KALO GA NGERTI DAPETINNYA BISA CHAT GW
            
            $getInfo = $this->request('https://i.instagram.com/api/v1/users/'.$username.'/usernameinfo/', $useragent, 0, $cookies);
            
            $getInfo = json_decode($getInfo[1]);

            print($getInfo);
            if($getInfo->user->is_private == true)
            {
                print 'Username '.$username.' Dalam Keadaan Private';
            }
            else
            {
                $userID = $getInfo->user->pk;
            }
            
            $userFeed = $this->request('https://i.instagram.com/api/v1/feed/user/'.$userID.'/', $useragent, 0, $cookies);
            $userFeed = json_decode($userFeed[1]);


            
            if($userFeed->status == 'ok')
            {
                
                $postUrl  = 'https://www.instagram.com/p/'.$userFeed->items[0]->code.'/';
                
                
                $cekpost = mysqli_query($con, "SELECT * FROM users_history WHERE target='".$postUrl."'");
                
                if(mysqli_num_rows($cekpost) == 0){
                    $ceklimit = DB::table('users_history')->whereDate('created_at', date('Y-m-d'))->where('type', 'Auto Like')->count();
                    
                    if($ceklimit <= 10){
                        $key = 'hgfghfghfgf657656756sadhghsadg';
                        $jml = 250;
                    
                        $this->proses2('https://103.52.147.51/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=2&quantity='.$jml);
                        $this->proses2('https://103.84.194.131/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=2&quantity='.$jml);
                        $this->proses2('https://103.252.100.74/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=2&quantity='.$jml);
                        $this->proses2('https://103.252.100.74/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=4&quantity='.$jml);
                        $uszz = "ivanz";
                    	$pws = "kntolz32";
                    	$result = $this->proses("http://167.99.202.150/kuy/bowokntolzx.php","urlxx={$postUrl}&jumlahlahx={$jml}",$uszz,$pws);
                    	$result = $this->proses("http://167.99.202.150/kuy/bowokntolzx.php","urlxx={$postUrl}&jumlahlahx={$jml}",$uszz,$pws);
                        
                        
                        $delay = 20;
                        
                        
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_4' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_1' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_6' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_5' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_7' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_8' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_9' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        
                        $history = new \App\History;
                        $history->submitted_by = $data['submitted_by'];
                        $history->target = $postUrl;
                        $history->type = 'Auto Like';
                        $history->total_submit = 1500;
                        
                        $history->ip = $_SERVER['REMOTE_ADDR'];
                        $history->save();
                    
                        echo '<p><span style="color:green">[SUKSES]</span>'.$postUrl.'</p>';
                    }
                }else{
                    echo '<p><span style="color:red">[GAGAL]</span>'.$postUrl.' Sudah di like!</p>';
                }
            }
            else
            {
                print 'Terjadi Kesalahan: '.$userFeed['message'];
            }
            
            sleep(10);
        }
        
    }
    
    public function cronauto15(){
        
        
        set_time_limit(10000);
        error_reporting(0);
        
        $con = mysqli_connect('localhost', 'instagr9_panel', '#=ZR0.ZZ.[x7', 'instagr9_panel');
        $query = mysqli_query($con, "SELECT * FROM auto LIMIT 10 OFFSET 150");
        while($data = mysqli_fetch_assoc($query)){
        
            $username  = $data['target']; # INPUT USERNAME TARGET HERE
            
            $useragent = 'Instagram 27.0.0.7.97 Android (18/4.3; 320dpi; 720x1280; Xiaomi; HM 1SW; armani; qcom; en_US)';
            $cookies   = 'ds_user=instamedia.co.id;shbid=155;shbts=1534506651.185972;rur=FTW;csrftoken=4QEAd8BJNSGTqwWsCsvkxQxaeHI7DOAh;mid=W3a2mgABAAGD9Er5fIbp7NT9Z73M;ds_user_id=7594907455;urlgen=\"{\\\"182.1.102.239\\\": 23693}:1fqdHH:HI8j_anm5-caDjyVAYsZx06rvPI\";sessionid=IGSC3fbd90b2c39f28944877b6acbfd5e7fff6fb05924cb2b66baa834c6d62552fc4%3AzT2Aco1apb0JpmVT8mRxVJHqQhYRpSab%3A%7B%22_auth_user_id%22%3A7594907455%2C%22_auth_user_backend%22%3A%22accounts.backends.CaseInsensitiveModelBackend%22%2C%22_auth_user_hash%22%3A%22%22%2C%22_platform%22%3A1%2C%22_token_ver%22%3A2%2C%22_token%22%3A%227594907455%3A2zgxLE6qYgzqkwSOs0u5PECU8ssWGUNQ%3A3afe52d6b3dbaf6acf732c272d9dc3f8a8bfeb6c90c2f5ef64d7769d0b112b76%22%2C%22last_refreshed%22%3A1534506651.1866247654%7D;mcd=3;'; # BISA DIGANTI PAKE COOKIES AKUN INSTAGRAM KALIAN, PAKE USERAGENT VERSION 27, KALO GA NGERTI DAPETINNYA BISA CHAT GW
            
            $getInfo = $this->request('https://i.instagram.com/api/v1/users/'.$username.'/usernameinfo/', $useragent, 0, $cookies);
            
            $getInfo = json_decode($getInfo[1]);

            print($getInfo);
            if($getInfo->user->is_private == true)
            {
                print 'Username '.$username.' Dalam Keadaan Private';
            }
            else
            {
                $userID = $getInfo->user->pk;
            }
            
            $userFeed = $this->request('https://i.instagram.com/api/v1/feed/user/'.$userID.'/', $useragent, 0, $cookies);
            $userFeed = json_decode($userFeed[1]);


            
            if($userFeed->status == 'ok')
            {
                
                $postUrl  = 'https://www.instagram.com/p/'.$userFeed->items[0]->code.'/';
                
                
                $cekpost = mysqli_query($con, "SELECT * FROM users_history WHERE target='".$postUrl."'");
                
                if(mysqli_num_rows($cekpost) == 0){
                    $ceklimit = DB::table('users_history')->whereDate('created_at', date('Y-m-d'))->where('type', 'Auto Like')->count();
                    
                    if($ceklimit <= 10){
                        $key = 'hgfghfghfgf657656756sadhghsadg';
                        $jml = 250;
                    
                        $this->proses2('https://103.52.147.51/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=2&quantity='.$jml);
                        $this->proses2('https://103.84.194.131/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=2&quantity='.$jml);
                        $this->proses2('https://103.252.100.74/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=2&quantity='.$jml);
                        $this->proses2('https://103.252.100.74/api2.php', 'api='.$key.'&action=add&link='.$postUrl.'&type=4&quantity='.$jml);
                        $uszz = "ivanz";
                    	$pws = "kntolz32";
                    	$result = $this->proses("http://167.99.202.150/kuy/bowokntolzx.php","urlxx={$postUrl}&jumlahlahx={$jml}",$uszz,$pws);
                    	$result = $this->proses("http://167.99.202.150/kuy/bowokntolzx.php","urlxx={$postUrl}&jumlahlahx={$jml}",$uszz,$pws);
                        
                        
                        $delay = 20;
                        
                        
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_4' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_1' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_6' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_5' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_7' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_8' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        \App\Delay::where('user_id', $data['user_id'])->update(['like_9' => date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:s') . $delay . ' minute'))]);
                        
                        $history = new \App\History;
                        $history->submitted_by = $data['submitted_by'];
                        $history->target = $postUrl;
                        $history->type = 'Auto Like';
                        $history->total_submit = 1500;
                        
                        $history->ip = $_SERVER['REMOTE_ADDR'];
                        $history->save();
                    
                        echo '<p><span style="color:green">[SUKSES]</span>'.$postUrl.'</p>';
                    }
                }else{
                    echo '<p><span style="color:red">[GAGAL]</span>'.$postUrl.' Sudah di like!</p>';
                }
            }
            else
            {
                print 'Terjadi Kesalahan: '.$userFeed['message'];
            }
            
            sleep(10);
        }
        
    }
    
    public function request($endpoint, $useragent, $post = 0, $cookies) {
    
    $ch = curl_init();

    curl_setopt($ch, CURLOPT_URL, $endpoint);
    curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
    curl_setopt($ch, CURLOPT_TIMEOUT, 20);
    curl_setopt($ch, CURLOPT_HEADER, 1);
    if($post) {
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
    }
    curl_setopt($ch, CURLOPT_COOKIE, $cookies);

    $crot = curl_exec($ch);
    $header_len = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
    $header = substr($crot, 0, $header_len);
    $body = substr($crot, $header_len);
    curl_close($ch);

    return array($header, $body);

    }
    
    public function proses2($api, $postdata){
            
    	$ch = curl_init($api);
    		
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_HEADER, 0);
        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
		curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
		curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    		
    		
        curl_setopt($ch, CURLOPT_POST, true);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
    
		
		curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)');
        $result = curl_exec($ch);
        if (curl_errno($ch)) {
            $result = curl_error($ch);
        }
				
        curl_close($ch);
            
    }
    
    function proses($url,$params,$username,$password){
            
    	 $ch = curl_init();
         curl_setopt($ch, CURLOPT_POST, 1);
         curl_setopt($ch, CURLOPT_POSTFIELDS, "username=$username&password=$password");
         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
         curl_setopt($ch, CURLOPT_COOKIEJAR, "-");
         curl_setopt($ch, CURLOPT_COOKIEFILE, "-");
         $result = curl_exec($ch);
         curl_setopt($ch, CURLOPT_URL, $url);
         curl_setopt($ch, CURLOPT_POST, 1);
         curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
         $result = curl_exec($ch);
         curl_close($ch);
    }
    
}