Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- error_reporting(0);
- include 'curl.php';
- include 'data.php';
- $host = "localhost";
- $user = "siteidto_repost";
- $pass = "))VgM4gA-]u7";
- $db = "siteidto_repost";
- $konek = mysql_connect($host, $user, $pass) or die ('Koneksi Gagal! ');
- mysql_select_db($db);
- $cek = mysql_query("SELECT * FROM ikiganteng WHERE mediaid='$mediaid'");
- $cek = mysql_num_rows($cek);
- if($cek != 0){
- echo "Failed, This photo already uploaded !";
- exit();
- } else {
- $agent = GenerateUserAgent();
- $guid = generate_guid();
- $device_id = "android-".$guid;
- $data ='{"device_id":"'.$device_id.'","guid":"'.$guid.'","username":"'.$usernamemu.'","password":"'.$passwordmu.'","Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}';
- $sig = GenerateSignature($data);
- $data = 'signed_body='.$sig.'.'.urlencode($data).'&ig_sig_key_version=4';
- $login = SendRequest('accounts/login/', true, $data, $agent, false);
- $obj = @json_decode($login[1], true);
- $status = $obj['status'];
- $pesan = $obj['message'];
- $nama = $obj['full_name'];
- if ($status == 'fail'){
- echo "<b><font color='red'>Invalid Username/Password</font></b>";
- } else {
- $data = GetPostData($filename);
- $post = SendRequest('media/upload/', true, $data, $agent, true);
- $obj = @json_decode($post[1], true);
- $status = $obj['status'];
- if ($status == "fail"){
- echo "<b><font color='red'>Failed upload, Try another photo !</font></b>";
- } else {
- $caption = preg_replace("/\r|\n/", "", $caption);
- $media_id = $obj['media_id'];
- $device_id = "android-".$guid;
- $data = '{"device_id":"'.$device_id.'","guid":"'.$guid.'","media_id":"'.$media_id.'","caption":"'.$caption.'","device_timestamp":"'.time().'","source_type":"5","filter_type":"0","extra":"{}","Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}';
- $sig = GenerateSignature($data);
- $new_data = 'signed_body='.$sig.'.'.urlencode($data).'&ig_sig_key_version=4';
- // Now, configure the photo
- $conf = SendRequest('media/configure/', true, $new_data, $agent, true);
- $obj = @json_decode($conf[1], true);
- $status = $obj['status'];
- $link1 = "https://instagram.com/p/".$obj['media']['code'];
- $link = $obj['media']['code'];
- if ($status == "fail"){
- echo $conf[1];
- } else {
- mysql_query("INSERT INTO ikiganteng(mediaid, caption, link) VALUES('$mediaid','$caption','$link1')");
- echo "<b>[@".$usernamemu."] <font color='green'>Success Upload Photo! Let's check your photo : <a href='https://instagram.com/p/".$link."'k target='_blank'/> Click here </a></font></b>";
- }
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement