Skip to content

Instantly share code, notes, and snippets.

@asterion
Created Mar 28, 2019
Embed
What would you like to do?
ropuesta
public function add_instagram_profile(){
$filename = sprintf('/tmp/profile.clapesuc.%s.json', date('Ymd'));
if (file_exists($filename)) {
$json = json_decode(file_get_contents($filename));
} else {
$url = 'https://api.instagram.com/v1/users/'.$this->instagram_uid.'?access_token='.$this->instagram_token;
$text = file_get_contents($url);
$json = json_decode($text);
file_put_contents($filename, $text);
}
//$json = json_decode(array());
return($json->data);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment