-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbot.php
More file actions
33 lines (23 loc) · 834 Bytes
/
Copy pathbot.php
File metadata and controls
33 lines (23 loc) · 834 Bytes
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
<?php
include('config.php');
// CODE 50 = User not found.
// CODE 63 = User has been suspended.
$usernames = explode(",",rtrim(file_get_contents('usernames.txt'),","));
foreach($usernames as $screen_name){
if($screen_name != ""){
$parameters = array('screen_name' => trim($screen_name), 'include_entities' => 'false');
$searches = json_encode($tw_connection->get('users/show', $parameters), TRUE);
$searches = json_decode($searches, TRUE);
if(isset($searches['errors'])){
if((int)$searches['errors'][0]['code'] == 50){
$body = "Twitter handle ".$screen_name." is available!";
$recipient_email = "";
$subject = $body;
$headers = "From: Your Name <".$recipient_email.">\r\n";
mail($recipient_email, $subject, $body, $headers);
}
}
sleep(1);
}
}
?>