Uploading photos to instagram, using a script

老子叫甜甜 提交于 2019-12-02 21:14:42

You can use this API: https://github.com/mgp25/Instagram-API

And here is an example how to upload photo to Instagram:

<?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();
}

Try this: http://lancenewman.me/posting-a-photo-to-instagram-without-a-phone/ - works nicely for me, the first run will fail though as you would need to authorize the connection first. Just login to Instagram using the web site and select "It Was Me' when prompted - after that it works like a charm. Your account may also need to be active for this type of thing to work, I had an issue previously where API posts didn't work if there were no posts on the account so as a general rule of thumb we do a few manual posts first from a device.

Hope this helps you.

Uploading on Instagram is possible.

POST https://instagram.com/api/v1/media/upload/

Check this code for example https://code.google.com/p/twitubas/source/browse/common/instagram.php

My challenge is out for people to fix this script so it is stand alone!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!