Instagram Basic Display API hook using PHP

Expand on my Instagram Basic Display API hook, using PHP, to check if token is close to expiring and fetch/store new token so it never 'expires'.

I am using Processwire's API but the set up is fairly standard.

// Instagram init

$instagramHttp = new WireHttp();

$instagramAccessToken = "???";

$instagramFields = "username,id,media_type,media_url,caption,tags,timestamp";

$instagramBase = "[login to view URL]$instagramFields&access_token=$instagramAccessToken";

// [login to view URL]$instagramAccessToken

// Instagram feed

wire()->addHookMethod('Page::instagramFeed', function($event) use($instagramHttp, $instagramBase) {

$page = $event->object;

// Get cache only if it's less than or equal to 30 minutes (1800 seconds)

$result = wire('cache')->get('instagramFeed', 1800);

if (!$result) {

$result = $instagramHttp->getJSON($instagramBase);

wire('cache')->save('instagramFeed', $result, 1800); // 30 minutes


$event->return = $result;



Block of code that I can use to fetch an Instagram feed and store the access token and check if the token has expired.

Habilidades: PHP, Arquitetura de software, MySQL, JavaScript, JSON

Veja mais: basic database using php, using php interact plesk api, display video using php, instagram basic display api example, instagram basic display api pagination, instagram api php, instagram graph api, instagram basic display api swift, instagram api php example, instagram basic display api python, instagram api examples, display csv using php, parse yahoo weather api using php, using php yahoo store tags, using php extract href tags img src tags, skype api access using php, basic student information program using php, templatemonster api script using php, basic member system website using php mysql, ups api integration using php

Acerca do Empregador:
( 0 comentários ) Santa Clara, United States

ID do Projeto: #27888003

1 freelancer está oferecendo em média $25 para esse trabalho

(127 Comentários)