-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstagram.php
31 lines (25 loc) · 892 Bytes
/
instagram.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
<form action="#">
<p>Digitar Username do Instagram</p>
<input type="text" name="username">
<button type="submit">Buscar</button>
</form>
<br>
<hr>
<?php
if(!empty($_GET) && $_SERVER['REQUEST_METHOD'] == 'GET'){
$username = $_GET['username'];
$response = @file_get_contents( "https://www.instagram.com/$username/?__a=1" );
if ( $response !== false ) {
$data = json_decode( $response, true );
if ( $data !== null ) {
$nome = $data['graphql']['user']['full_name'];
$seguidores = $data['graphql']['user']['edge_followed_by']['count'];
$seguindo = $data['graphql']['user']['edge_follow']['count'];
echo "$nome tem $seguidores seguidores, ele segue $seguindo pessoas";
}
} else {
echo 'erro ao Buscar username';
}
die();
}
?>