Example #1
1
function getCookie($userData)
{
    $agent = GenerateUserAgent();
    $guid = GenerateGuid();
    $device_id = "android-" . $guid;
    $data = '{"device_id":"' . $device_id . '","guid":"' . $guid . '","username":"******","password":"******","Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}';
    $sig = GenerateSignature($data);
    $data = 'signed_body=' . $sig . '.' . urlencode($data) . '&ig_sig_key_version=4';
    $response = SendRequest(array('url' => 'https://i.instagram.com/api/v1/accounts/login/', 'post' => $data, 'agent' => $agent, 'PATH_COOKIE' => $userData['PATH_COOKIE']));
    $data = json_decode($response[1]);
    return array('status' => !empty($data) && $data->status == 'ok' ? 200 : 400, 'data' => $data);
}
Example #2
1
function postingImage($conf)
{
    $image = GetPostData($conf['PATH_IMAGE']);
    $agent = GenerateUserAgent();
    $dataUpload = SendRequest(array('url' => 'https://i.instagram.com/api/v1/media/upload/', 'post' => $image, 'agent' => $agent, 'useCookie' => true, 'PATH_COOKIE' => $conf['PATH_COOKIE']));
    $response = json_decode($dataUpload[1]);
    if (empty($response) || $response->status != 'ok') {
        return $response = array('status' => $response->status, 'data' => $response);
    }
    $guid = GenerateGuid();
    $device_id = "android-" . $guid;
    $requestData = '{"device_id":"' . $device_id . '","guid":"' . $guid . '","media_id":"' . $response->media_id . '","caption":"' . trim($conf['title']) . '","device_timestamp":"' . time() . '","source_type":"5","filter_type":"0","extra":"{}","Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}';
    $sig = GenerateSignature($requestData);
    $new_data = 'signed_body=' . $sig . '.' . urlencode($requestData) . '&ig_sig_key_version=4';
    $response = SendRequest(['url' => 'https://i.instagram.com/api/v1/media/configure/', 'post' => $new_data, 'agent' => $agent, 'useCookie' => true, 'PATH_COOKIE' => $conf['PATH_COOKIE']]);
    $data = json_decode($response[1]);
    return array('status' => !empty($data) && $data->status == 'ok' ? 200 : 400, 'data' => $data);
}
goes correctly. In addition to being one of the most popular apps on the market right now, it is
also one of the toughest to spam. Be cautioned that constantly logging into different accounts from
the same IP address will almost certainly be a quick way to get your accounts banned. Just keep that
in mind before proceeding with this script. Allocating a unique proxy and user agent to each account
would do a terrific job of helping keep accounts secure.
*/
// Set the username and password of the account that you wish to post a photo to
$username = '******';
$password = '******';
// Set the path to the file that you wish to post.
// This must be jpeg format and it must be a perfect square
$filename = 'pictures/test.jpg';
// Set the caption for the photo
$caption = "Test caption";
// Define the user agent
$agent = GenerateUserAgent();
// Define the GuID
$guid = GenerateGuid();
// Set the devide ID
$device_id = "android-" . $guid;
/* LOG IN */
// You must be logged in to the account that you wish to post a photo too
// Set all of the parameters in the string, and then sign it with their API key using SHA-256
$data = '{"device_id":"' . $device_id . '","guid":"' . $guid . '","username":"******","password":"******","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);
if (strpos($login[1], "Sorry, an error occurred while processing this request.")) {
    echo "Request failed, there's a chance that this proxy/ip is blocked";
} else {
    if (empty($login[1])) {