Created
November 26, 2015 23:29
-
-
Save mgp25/d1cd0ed33c8b01a6013e to your computer and use it in GitHub Desktop.
Example: Upload photo to Instagram using https://github.com/mgp25/Instagram-API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| require '../src/Instagram.php'; | |
| /////// CONFIG /////// | |
| $username = ''; | |
| $password = ''; | |
| $debug = false; | |
| $photo = ''; // path to the photo | |
| $caption = null; // caption | |
| ////////////////////// | |
| $i = new Instagram($username, $password, $debug); | |
| try{ | |
| $i->login(); | |
| } catch (InstagramException $e) | |
| { | |
| $e->getMessage(); | |
| exit(); | |
| } | |
| try { | |
| $i->uploadPhoto($photo, $caption); | |
| } catch (Exception $e) | |
| { | |
| echo $e->getMessage(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
THis shit is not working "message: Your account has been disabled for violating our terms: http://instagram.com/about/legal/terms/ "