Skip to content

Instantly share code, notes, and snippets.

@mgp25
Created November 26, 2015 23:29
Show Gist options
  • Select an option

  • Save mgp25/d1cd0ed33c8b01a6013e to your computer and use it in GitHub Desktop.

Select an option

Save mgp25/d1cd0ed33c8b01a6013e to your computer and use it in GitHub Desktop.
Example: Upload photo to Instagram using https://github.com/mgp25/Instagram-API
<?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();
}
@ecommercecmsorg
Copy link

THis shit is not working "message: Your account has been disabled for violating our terms: http://instagram.com/about/legal/terms/ "

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment