예제 #1
0
파일: follows.php 프로젝트: rhamdeew/InStat
	</style>
	<title>Статистика пользователя</title>
</head>
<body>
<?php 
$userid = 'self';
if (isset($_GET['username'])) {
    $result = $instagram->searchUser($_GET['username'], 1);
    if (is_object($result)) {
        if ($result->meta->code == 200) {
            $userid = $result->data[0]->id;
        }
    }
}
if (isset($_SESSION['access_token'])) {
    $instagram->setAccessToken($_SESSION['access_token']);
    $next = '';
    $follows = $instagram->getUserFollows($userid, 100);
    $follow = array();
    if (is_object($follows)) {
        if ($follows->meta->code == 200) {
            foreach ($follows->data as $item) {
                $follow[$item->id] = $item->username;
            }
            if (isset($follows->pagination->next_cursor)) {
                $next = $follows->pagination->next_cursor;
            }
        }
    }
    $i = 0;
    while (!empty($next)) {