Uploading photos to instagram, using a script

2019-03-11 09:52发布

Is it possible to upload photos from a webpage to Instagram, if so how do you do it?

I am wondering how to do this, so I can have a website where people can vote on their favourite photo and the one with most votes will be posted each day!

3条回答
Summer. ? 凉城
2楼-- · 2019-03-11 10:49

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.

查看更多
【Aperson】
3楼-- · 2019-03-11 10:51

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();
}
查看更多
Evening l夕情丶
4楼-- · 2019-03-11 10:53

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!

查看更多
登录 后发表回答