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.
– Renato Ferreira Soares
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.
– Rafael Cavalcante
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!
– Gabriel Selga Vital
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.
– user148754