Exemple #1
0
function getGaps()
{
    global $district_code;
    $return = [];
    foreach ($districts as $district_code) {
        $return[$district_code] = getGap($district_code);
    }
    echo json_encode($return);
    exit;
}
    $tokenSet = false;
}
$instagramMediaResults = $instagram->getMedia($media_id, $tokenSet);
foreach ($instagramMediaResults as $post) {
    if (isset($post->id)) {
        if ($media_id == $post->id) {
            $instagramImg = $post->images->standard_resolution->url;
            $imgWidth = $post->images->standard_resolution->width;
            $imgHeight = $post->images->standard_resolution->height;
            $caption = $post->caption->text;
            $captionCreated = $post->caption->created_time;
            $creatorUsername = $post->user->username;
            $creatorProfilePic = $post->user->profile_picture;
            $captionDateGap = getGap($captionCreated);
            $imageCreated = $post->created_time;
            $imageDateGap = getGap($imageCreated);
            if (isset($post->location->name)) {
                $locationName = $post->location->name;
            }
            $blnUserLiked = $post->user_has_liked;
            $objImgLikes = $post->likes;
            $objImgComments = $instagram->getMediaComments($media_id);
            if ($post->type == 'video') {
                $isVideo = true;
                if ($deviceType == 'phone') {
                    $instagramVideo = $post->videos->low_resolution->url;
                } else {
                    $instagramVideo = $post->videos->standard_resolution->url;
                }
            } else {
                $isVideo = false;