加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

php – 使用脚本将照片上传到instagram

发布时间:2020-12-13 17:54:11 所属栏目:PHP教程 来源:网络整理
导读:是否可以将照片从网页上传到Instagram,如果是这样,你怎么做? 我想知道如何做到这一点,所以我可以有一个网站,人们可以在他们最喜欢的照片上投票,每天都会发布票数最多的人! 您可以使用此API: https://github.com/mgp25/Instagram-API 以下是如何将照片上传
是否可以将照片从网页上传到Instagram,如果是这样,你怎么做?

我想知道如何做到这一点,所以我可以有一个网站,人们可以在他们最喜欢的照片上投票,每天都会发布票数最多的人!

您可以使用此API: https://github.com/mgp25/Instagram-API

以下是如何将照片上传到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();
}

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读