public function testDefaultData()
 {
     $this->config = array('client_id' => 'MyClientId', 'client_secret' => 'MyClientSecret', 'redirect_uri' => 'MyRedirectURL');
     Instagram::init($this->config);
     $this->assertEmpty(Instagram::getData());
 }
예제 #2
0
<?php

require_once 'vendor/autoload.php';
use Instagram\Classe\Instagram;
$config = array('client_id' => 'be000232443747b699ffaabbb05b9ae0', 'client_secret' => '4e6ef1e5c70f47619d56dad1db4f4a3f', 'redirect_uri' => 'http://localhost:8000/easy-instagram/');
try {
    Instagram::init($config);
} catch (Exception $e) {
    echo $e->getMessage();
}
if (isset($_GET['code'])) {
    Instagram::getAccessToken($_GET['code']);
    $data = Instagram::getData();
    $id = $data['user']['id'];
}
?>
<!DOCTYPE html>
<html lang="pt-br" dir="ltr">
	<head>
		<meta charset="utf-8"/>
		<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8"/>
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<title>
			Instagram - API	
		</title>
		<link rel="stylesheet" type="text/css" href="Public/Css/Bootstrap.min.css">
	</head>
	<body>
		<div class="jumbotron" style="background-color:#5AA5E6; color:#fff;">
			<div class="container">
				<h1>Easy-Instagram</h1>