Help with Instagram API

Asked

Viewed 1,555 times

5

I’m trying to consume to API of Instagram and I observed here in stackoverflow community on the library so-called Instafeed.JS, with this I followed the official documentation of the same in your github repository.

I already have the registration on the official website Instagram Developer and with it I have the id_client, secret key and the token, but I’m not able to consume the same. Follow my code below:

ASP

<%@page contentType="text/html" pageEncoding="UTF-8"%>

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<%--
    This file is an entry point for JavaServer Faces application.
--%>
<f:view>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-    8"/>
            <script type="text/javascript" src="instafeed.min.js"></script>
            <script type="text/javascript" src="app.js"></script>
            <title>JSP Page</title>
        </head>
        <body>
            <h1><h:outputText value="JSF e Jsp"/></h1>
            <button onclick="doAPI()">Fornecer Client ID e rodar</button>
            <br />
            <h3>Rock Tag</h3>
                <div id="rockTag"></div>
            <h3>Glass Tag</h3>
                <div id="glassTag"></div>
            <h3>Wood Tag</h3>
                <div id="woodTag"></div>
        </body>
    </html>
</f:view>

JS

function getMultipleTags (tags,client) {
    var feeds = [];
    for (var i=0, len=tags.length; i < len; i++) {
        feeds.push(new Instafeed({
            // rest of your options
            get: 'tagged',
            tagName: tags[i],
            target: tags[i] + "Tag",
            limit: 3,
            clientId: client,
            template: '<div class="insta-pic"><a href="{{link}}"><img src="    {{image}}" /></a></div>'
        }));
    }
    return feeds;
}
function doAPI() {
     var  client = window.prompt("Sua ID:", '');
     if( client ) {
        // get multiple tags
        var myTags = getMultipleTags(['glass', 'wood', 'rock'],client);
        // run each instance
        for(var i=0, len=myTags.length; i < len; i++) {
            myTags[i].run();
        }
    }
}
  • The API apparently answered nothing.

  • 3

    Instagram has made a modification to its API where all applications have been moved to Sandbox mode. Exists an Issue on the github and you can learn more about it at official page of sandbox mode.

  • instagram closed several endpoints of its API, leaving only the option of the user who accepts your APP to get their own photos, tells me what you want to do to see if I can help!

  • What @Rafaelcavalcante said is true, I analyzed in the documentation official Instagram API and I have already entered you as an answer. I ask you kindly to read hard about how to create a good question here in the community, because it was missing really what problem occurred, you just posted the code and did not detail and elaborated the question correctly.

1 answer

2

According to the official website of API of instagram they say the following in a note:

To continuously improve the privacy and security of Instagram users, we are accelerating the depreciation of the Instagram API Platform, making the following changes take effect immediately. We understand that this can affect your business or services and appreciate your support to keep our platform safe.

Those resources will be deactivated immediately (previously set for July 31, 2018 or December 11, 2018, discontinued). The following shall be suspended according to the time line which we previously shared :

Public content - all remaining resources to read public media on behalf of a user on December 11, 2018 Basic - to read user and media profile information in early 2020. For your reference, information on the new Instagram graphics API.

To start the requests to API you must follow the steps: inserir a descrição da imagem aqui

The last commit in accordance with the official github of the cited library was on the following date: Sep 6, 2018. Soon the Instagram announced the depreciation on the date of: July 31, 2018 or December 11, 2018. So for the sake of security guard, compatibility, maintenance among others I suggest that I stopped using to Instafeed.JS library and study hard to official instagram API documentation, to be able to create your system and/or mobile application and even to be able to elaborate an architecture plan of the same.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.