diff --git a/Samples/instagram.php b/Samples/instagram.php new file mode 100644 index 0000000..63c8ad3 --- /dev/null +++ b/Samples/instagram.php @@ -0,0 +1,54 @@ + 'YOUR_APP_KEY', + 'apiSecret' => 'YOUR_APP_SECRET', + 'apiCallback' => 'YOUR_APP_CALLBACK' +)); + +$result = $instagram->getPopularMedia(); + +foreach ($result->data as $media) { + $content = "
  • "; + // output media + if ($media->type === 'video') { + // video + $poster = $media->images->low_resolution->url; + $source = $media->videos->standard_resolution->url; + $content .= ''; + } else { + // image + $image = $media->images->low_resolution->url; + $content .= ''; + } + // create meta section + $avatar = $media->user->profile_picture; + $username = $media->user->username; + $comment = (!empty($media->caption->text)) ? $media->caption->text : ''; + $content .= '
    +
    +

    ' . $username . '

    +
    ' . $comment . '
    +
    '; + // output media + echo $content . "
  • "; +} +?> \ No newline at end of file