├── fake_database.txt ├── config.php.sample ├── readme ├── api_config_setup.png └── fake_instagram.png ├── index.php ├── callback.php ├── view.php ├── README.md ├── http.php └── settings-functions.php /fake_database.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /config.php.sample: -------------------------------------------------------------------------------- 1 | Instagram Basic Display Test"; 6 | 7 | $login_url = getLoginURL(); 8 | 9 | echo "$login_url"; 10 | -------------------------------------------------------------------------------- /callback.php: -------------------------------------------------------------------------------- 1 | "; 5 | 6 | // now let's see if we can read in our user 7 | $userData = file_get_contents('fake_database.txt'); 8 | 9 | $userData = json_decode($userData, true); 10 | 11 | // easier to just ensure that this exists 12 | if (!isset($userData["posts"])) { 13 | $userData["posts"] = array(); 14 | } 15 | 16 | $media = getMedia($userData["ig_access_token"], $userData["posts"]); 17 | 18 | // now let's save our "user" to the database 19 | $fake_user_data_array = array(); 20 | $fake_user_data_array["ig_user_id"] = $userData["ig_user_id"]; 21 | $fake_user_data_array["ig_access_token"] = $userData["ig_access_token"]; 22 | $fake_user_data_array["ig_access_token_last_updated"] = time(); 23 | $fake_user_data_array["posts"] = $media; 24 | writeJsonToFile($fake_user_data_array); 25 | 26 | foreach ($media as $media_item) { 27 | echo " 28 | 29 |
".$media_item["caption"]."
33 |