rei*_*ako 7 php photos instagram
是否可以将照片从网页上传到Instagram,如果是这样,你怎么做?
我想知道如何做到这一点,所以我可以有一个网站,人们可以在他们最喜欢的照片上投票,每天都会发布票数最多的人!
小智 5
您可以使用此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();
}
Run Code Online (Sandbox Code Playgroud)
可以在 Instagram 上上传。
POST https://instagram.com/api/v1/media/upload/
Run Code Online (Sandbox Code Playgroud)
检查此代码,例如https://code.google.com/p/twitubas/source/browse/common/instagram.php
我的挑战是让人们修复这个脚本,使其成为独立的!