Skip to content

Instantly share code, notes, and snippets.

@asterion
Created March 28, 2019 21:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save asterion/ae139a3404cfa658755fac26f5f210b7 to your computer and use it in GitHub Desktop.
Save asterion/ae139a3404cfa658755fac26f5f210b7 to your computer and use it in GitHub Desktop.
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