-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.php
73 lines (57 loc) · 1.86 KB
/
index.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<?php
require 'vendor/autoload.php';
use Entity\User;
use InstagramScraper\Instagram;
use Repository\CommentsRepository;
use Repository\FollowsRepository;
use Repository\UsersRepository;
use Util\AccountWorker;
use Repository\StatisticsRepository;
function getUserAndPass()
{
return explode(" ", file_get_contents("config", FILE_USE_INCLUDE_PATH));
}
function registration($login, $pass, &$instagram, &$settings){
$instagram = Instagram::withCredentials($login, $pass);
$instagram->login();
$settings = [
'comments_selected' => true,
'likes_selected' => true,
'following_selected' => true,
'genesis_account_bot_selected' => true,
'hashtag_bot_selected' => true,
'geotag_bot_selected' => true
];
$user = new User($instagram->getAccount($login)->getId(), $login, $pass,
null, time(), 0, $settings);
//UsersRepository::add($user);
//CommentsRepository::createTable($user->getUserId());
//FollowsRepository::createTable($user->getUserId());
//StatisticsRepository::add(new \Entity\BotProcessStatistics($user->getUserId()));
return $user;
}
//$user = UsersRepository::getBy(['id' => 1])[0];
//$accounts = \Repository\AccountsRepository::getAll();
//foreach ($accounts as $account)
// \Repository\AccountsRepository::delete($account);
//$arr = array_map(function(&$value){
// if(isset($value))
// return true;
// return $value;
//}, $user->getSettings());
//
//$arr['hashtags'] = 'sos';
//$arr = getUserAndPass();
//$user = registration($arr[0], $arr[1], $instagram, $settings);
/*
$fl = $instagram->getFollowing($instagram->getAccount($instagram->getSessionUsername())->getId(), 100);
foreach ($fl as $item) {
try {
$instagram->unfollow($item['id']);
}
catch (Exception $e){
if (substr($e->getMessage(), 17, 3) == 403)
sleep(3);
}
}
*/