Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- filename : like.php
- */
- @ini_set("output_buffering", "Off");
- @ini_set('implicit_flush', 1);
- @ini_set('zlib.output_compression', 0);
- @ini_set('max_execution_time',1200);
- header( 'Content-type: text/html; charset=utf-8' );
- include('config.php');
- function SendRequest($url, $post, $post_data, $user_agent, $cookies) {
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, 'https://instagram.com/api/v1/'.$url);
- curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
- curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept-Language: id'));
- if($post) {
- curl_setopt($ch, CURLOPT_POST, true);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
- }
- if($cookies) {
- curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookies.txt');
- } else {
- curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookies.txt');
- }
- $response = curl_exec($ch);
- $http = curl_getinfo($ch, CURLINFO_HTTP_CODE);
- curl_close($ch);
- return array($http, $response);
- }
- function GenerateGuid() {
- return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
- mt_rand(0, 65535),
- mt_rand(0, 65535),
- mt_rand(0, 65535),
- mt_rand(16384, 20479),
- mt_rand(32768, 49151),
- mt_rand(0, 65535),
- mt_rand(0, 65535),
- mt_rand(0, 65535));
- }
- function GenerateUserAgent() {
- $resolutions = array('720x1280', '320x480', '480x800', '1024x768', '1280x720', '768x1024', '480x320');
- $versions = array('GT-N7000', 'SM-N9000', 'GT-I9220', 'GT-I9100');
- $dpis = array('120', '160', '320', '240');
- $ver = $versions[array_rand($versions)];
- $dpi = $dpis[array_rand($dpis)];
- $res = $resolutions[array_rand($resolutions)];
- return 'Instagram 4.'.mt_rand(1,2).'.'.mt_rand(0,2).' Android ('.mt_rand(10,11).'/'.mt_rand(1,3).'.'.mt_rand(3,5).'.'.mt_rand(0,5).'; '.$dpi.'; '.$res.'; samsung; '.$ver.'; '.$ver.'; smdkc210; en_US)';
- }
- function GenerateSignature($data) {
- return hash_hmac('sha256', $data, 'b4a23f5e39b5929e0666ac5de94c89d1618a2916');
- }
- $agent = GenerateUserAgent();
- $guid = GenerateGuid();
- $device_id = "android-".$guid;
- echo "-- Grab Foto Timeline Instagram --<br/>";
- $feed = SendRequest('feed/timeline/?max_id=', false, false, $agent, true);
- $obj = json_decode($feed[1]);
- foreach ($obj->items as $items) {
- $mau_ngelike = $items->mau_ngelike;
- if($mau_ngelike == False) {
- $ID = $items->id;
- $user = " @". $items->user->username;
- $data = '{"media_id":"'.$ID.'"}';
- $sig = GenerateSignature($data);
- $new_data = 'signed_body='.$sig.'.'.urlencode($data).'&ig_sig_key_version=4';
- $like = SendRequest('media/'.$ID.'/'.$action.'/', true, $new_data, $agent, true);
- echo "[+] <font color=green>Sukses Like @" . $items->user->username . "</font><br/>";
- } else {
- echo "Fotonya @" . $items->user->username . " sudah di like.<br/>";
- }
- if($komen == true){
- $comment_text = $comment_text;
- $data = '{"comment_text":"'.$comment_text.'"}';
- $sig = GenerateSignature($data);
- $new_data = 'signed_body='.$sig.'.'.urlencode($data).'&ig_sig_key_version=4';
- $post_comment = SendRequest('media/'.$ID.'/comment/', true, $new_data, $agent, true);
- $obj3 = json_decode($post_comment[1]);
- //print_r($post_comment);
- if ($obj3->status == "ok") {
- echo "[+] <font color=green>Sukses Komen</font><br/>";
- sleep(2); //Takut kena blokir komen :v
- } else {
- echo "[-] <font color=red>Gagal komen</font><br/>";
- }
- }
- flush();
- ob_flush();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement