foreach ($entry->comments as $comment) { $html .= '<small><a href="index.php?user='******'">' . $comment->user->username . '</a></small> ' . htmlspecialchars($comment->text) . '<br />'; } $html .= ' </p>'; } $html .= '</div>'; return $html; } /** * Do the API-calls now */ try { $inst = new Instagram(); $inst->auth->login($username, $password, $deviceId); if (isset($_GET['user']) && is_numeric($_GET['user']) && !isset($_GET['hidebacklink'])) { echo '<p><a href="index.php"><< Back to my feed</a></p>'; $feed = $inst->feed->user((int) $_GET['user']); } else { $feed = $inst->feed->timeline(); } $inst->run(); $response = $feed->getResponse()->getData(); foreach ($response as $rentry) { echo printEntry($rentry); } } catch (Instagram_Exception $ex) { echo "<pre>\n\n ERROR: {$ex->getMessage()}\n\n" . var_export($ex->getResponse(), 1) . "\n\n{$ex}\n\n</pre>"; } ?> </body></html>