예제 #1
0
파일: follows.php 프로젝트: rhamdeew/InStat
			text-align: left;
			margin:auto;
		}
		td {
			border: 1px solid #CCC;
			padding: 10px;
			background-color: #ccff9a;
		}
	</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;