johnshopkins/instahook

Simple wrapper for the Instagram API

Installs: 1 996

Dependents: 1

Stars: 2

Watchers: 1

Language: PHP

v1.0 2014-07-02 18:01 UTC

README

PHP wrapper for the Instagram API

Example

HttpExchange, CacheExchange, and Resty components autoloaded with Composer.

<?php

include "path/to/vendor/autoload.php";

$httpEngine = new \HttpExchange\Adapters\Resty(new \Resty());
$datastore = new \CacheExchange\Adapters\APC();
$cache = new \CacheExchange\Cache($datastore);

$insta = new \InstaHook\Client($httpEngine, $cache, "yourClientID");

$media = $insta->getPopularMedia();

foreach ($media->data as $media) {
    echo "<img src=\"" . $media->images->low_resolution->url . "\" />";
}