-
Notifications
You must be signed in to change notification settings - Fork 6
/
target_user_following_follower.php
42 lines (39 loc) · 1.47 KB
/
target_user_following_follower.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
require __DIR__."/vendor/autoload.php";
require __DIR__."/config.php";
$instagram = new \InstagramAPI\Instagram(false, false);
$signature = \InstagramAPI\Signatures::generateUUID();
try
{
echo("[?] Try for login as {$account['username']}...\n");
$instagram->login($account['username'], $account['password']);
echo("[!] Login successfully!\n");
sleep(2);
echo("[!] Getting {$target_user_following_follower['target_username']}'s following...\n");
$next_max_id = null;
$target_user = $instagram->people->getUserIdForName($target_user_following_follower['target_username']);
do
{
$users = $instagram->people->getFollowing($target_user, $signature, null, $next_max_id);
foreach($users->getUsers() as $user)
{
$follow = $instagram->people->follow($user->getPk());
if($follow->getStatus() == "ok")
{
echo "[+] ".date("d-m-Y H:i:s")." on ".$user->getUsername()." user was followed.\n";
sleep($target_user_following_follower['interval']);
}
else
{
echo "[!] ".date("d-m-Y H:i:s")." on have a error, please wait for next job in {$target_user_following_follower['have_err']} seconds.\n";
sleep($target_user_following_follower['have_err']);
}
}
$next_max_id = $users->getNextMaxId();
}
while($next_max_id !== null);
}
catch(Exception $e)
{
echo("[!] ".$e->getMessage()."\n");
}