Example #1
0
<?php

// ini_set('display_errors', 'off');
require '../vendor/autoload.php';
$instagram = new Andreyco\Instagram\Client(array('apiKey' => 'YOUR_APP_KEY', 'apiSecret' => 'YOUR_APP_SECRET', 'apiCallback' => 'YOUR_APP_CALLBACK', 'scope' => array('basic', 'comments', 'relationships', 'likes')));
// create login URL
$state = md5(time());
$loginUrl = $instagram->getLoginUrl(array('relationships'), $state);
?>

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Instagram - OAuth Login</title>
    <link rel="stylesheet" type="text/css" href="assets/style.css">
    <style>
      .login {
        display: block;
        font-size: 20px;
        font-weight: bold;
        margin-top: 50px;
      }
    </style>
  </head>
  <body>
    <div class="container">
      <header class="clearfix">
        <h1>Instagram <span>display your photo stream</span></h1>
      </header>