Skip to content

Instantly share code, notes, and snippets.

@thenewlove
Created December 16, 2018 11:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thenewlove/981c0aa0e238e750ba5297e3ad5ab000 to your computer and use it in GitHub Desktop.
Save thenewlove/981c0aa0e238e750ba5297e3ad5ab000 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="vi">
<head>
<meta charset=utf8 />
<title>Tool lấy danh sách bạn bè là nữ</title>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap-theme.min.css">
</head>
<?php
@set_time_limit(0);
/*
Tool lấy danh sách bạn bè là nữ
Website: https://www.starmanh.net/
Fanpage: https://www.facebook.com/starmanh.net/
Google++: https://plus.google.com/100812342798046924714
Coder By: StarMạnh(PNM)
*/
function curl($url)
{
$ch = curl_init();
curl_setopt_array($ch,[
CURLOPT_URL =>$url,
CURLOPT_HEADER =>false,
CURLOPT_FOLLOWLOCATION =>true,
CURLOPT_RETURNTRANSFER =>true,
CURLOPT_USERAGENT => 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36',
]);
return curl_exec($ch);
curl_close($ch);
}
?>
<body>
<div class="container">
<center><h2>Lấy danh sách bạn bè là nữ</h2></center>
<form class="form-horizontal" method="POST" action="" role="form">
<div class="form-group">
<label class="col-sm-2 control-label">Token: </label>
<div class="col-sm-10">
<input type="text" name="token" class="form-control" placeholder="Nhập Token Vào Đây">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Số lượng: </label>
<div class="col-sm-10">
<input type="number" name="limit" class="form-control" placeholder="Nhập số lượng cần lấy tối đa 5000" min="1" max="5000">
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-default">Send</button>
</div>
</div>
</form>
<?php
if (isset($_POST['token']) && isset($_POST['limit']))
{
$a = json_decode(curl('https://graph.facebook.com/me?access_token='.$_POST['token']),true);
if ($a['id'])
{
if ($_POST['limit'] > 0 && $_POST['limit'] < 5001)
{
$api = json_decode(curl('https://graph.facebook.com/fql?access_token='.$_POST['token'].'&q=SELECT%20friend_count,%20uid,%20name,%20birthday%20FROM%20user%20WHERE%20uid%20IN%20(SELECT%20uid2%20FROM%20friend%20WHERE%20uid1%20=%20me())%20AND%20sex%20!=%20%22male%22%20ORDER%20BY%20rand()%20LIMIT%20'.$_POST['limit'].''),true);
echo ' <table class="table"><tr><th>Avatar</th> <th>Ten</th> <th>ID</th> <th>Số BB</th> <th>Ngày sinh</th> </tr>';
for ($i=0;$i<count($api['data']);$i++)
{
$id = number_format($api['data'][$i]['uid'],0,'','');
echo '
<tr><td><img src="https://graph.facebook.com/'.$id.'/picture"></td>
<td><a href="https://www.fb.com/'.$id.'" target="_blank">'.$api['data'][$i]['name'].'</a></td>
<td>'.$id.'</td>
<td>'.$api['data'][$i]['friend_count'].'</td>
<td>'.$api['data'][$i]['birthday'].'</td></tr>';
}
echo '</table>';
}else{echo 'Số lượng tối đa là 5000 !';};
}else{exit('Token Die !');}
}
?>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment