网络应用程序的正确instagram身份验证方法(没有instagram帐户的用户)

correct instagram authentication method for web applications (users without instagram account)

本文关键字:instagram 没有 用户 身份验证 应用程序 网络 方法      更新时间:2023-09-26

我想在我的婚礼网站上显示所有带有特定标签的instagram图片,与发布它的用户无关,也不要求我的网站用户登录instagram(他们不能有instagram帐户!)。什么是最好和正确的方法?

我现在在做什么:

1) 我在我的个人instagram"管理客户"部分配置了一个新客户"婚礼"。

2) 我有一个令牌调用MANUALLY(我的意思是在我的个人浏览器中复制并通过一次url)以下url:

https://api.instagram.com/oauth/authorize/?client_id=client_id_of_my_client_wedding&redirect_uri=redirect_uri_of_my_client婚礼&response_type=令牌

并在Instagram登录弹出窗口询问后使用我的个人帐户登录Instagram

3) 我在我的html页面中添加了以下javascript:

<script>
function myinstagramfunction (json_object)
{
    // I fetch here the json object that contains the info of all the pictures returned
}
</script>
<script type="text/javascript" src="https://api.instagram.com/v1/tags/<my_wedding_tag>/media/recent?access_token=<token_retrieved_in_step_2>&callback=myinstagramfunction"/>

第二个脚本使用JSONP(带填充的JSON)对instagramapi执行跨域调用,并调用我的本地函数"myinstagramfunction"。

问题:

a) 这是正确的方法,也是instagram官方建议/允许的方法吗?

b) 当前客户端Wedding配置为"沙盒模式"。你是否建议将其提交给instagram审批,或者我的程序中是否有不允许的内容?

请告诉我!

谢谢

Davide

类似https://lightwidget.com/不符合你的需求?

无需编码技能,只需复制粘贴即可。。我认为这应该适用于除草网站。

编辑:

好吧,试试这个方法:

function myinstagramfunction (json_object)
{
    // I fetch here the json object that contains the info of all the pictures returned
    console.log("OK");
}
$.ajax({
   type: "GET",
   dataType: "jsonp",
   url: 'https://api.instagram.com/v1/tags/YOUR_HASHTAG/media/recent?access_token=YOUR_ACCESS_TOKEN_HERE&callback=myinstagramfunction',
   success: function (result) {
      console.log(result);
   }
});

请记住,Instagram api调用有速率限制。