-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmuter.php
57 lines (48 loc) · 1.69 KB
/
muter.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
<?php
$CONSUMER_KEY = '';
$CONSUMER_SECRET = '';
$ACCESS_TOKEN = '';
$ACCESS_TOKEN_SECRET = '';
require_once ('codebird.php');
require_once ('muter_class.php');
\Codebird\Codebird::setConsumerKey($CONSUMER_KEY, $CONSUMER_SECRET);
$cb = \Codebird\Codebird::getInstance();
$cb->setToken($ACCESS_TOKEN, $ACCESS_TOKEN_SECRET);
/**
* Settings
*/
if ($_GET['next_cursor']) $params['cursor'] = $_GET['next_cursor'];
if ($_GET['page']) $page = $_GET['page'] + 1;
else $page = 1;
$api = 'followers/list';
$params['count'] = 50;
$params['skip_status'] = 1;
$followers = (array )$cb->$api($params);
/**
* ForEach User
*/
foreach ($followers['users'] as $user) {
$muter = new Muter($user);
$muter->lang()->background()->showBad()->showGood();
if ($muter->muteMe == true){
$follow_api = 'mutes_users/create';
$follow_params['user_id'] = $user->id;
$follow_data = (array )$cb->$follow_api($follow_params);
} else {
$follow_api = 'mutes_users/destroy';
$follow_params['user_id'] = $user->id;
$follow_data = (array )$cb->$follow_api($follow_params);
}
$output .= $muter->returnString;
$i++;
}
/**
* Redirect
*/
if ($followers['next_cursor']) {
header("refresh:50;url=muter.php?page=".$page."&next_cursor=" . $followers['next_cursor'] . "&page=".$page);
echo '<hr><h4> Remaining '.$followers['rate']->remaining.'</h4><hr>'.$output.'<pre>';
} else {
echo 'No more next';
}
?>