We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi,
I've looked the forum for a still working explanation but found none. after some searching I found a link to this example to get a token to talk to Instagram and a accompanying code to test it. The only thing is the code is a jquery example. Is it still possible to connect via P5js with a oauth token? And get data from Instagram. And mybe somebody who knows an example page so I can see how it works and get the hang of things? Or how I can read JSON parts of my instagram feed.
Because Jquery is a javascript frame work I thought why on try it out and see what happens.. Which ofcourse got me an error which console logged as
sketch.js:7 Uncaught ReferenceError: $ is not defined
at Object.init (sketch.js:7)
at sketch.js:20
init @ sketch.js:7
(anonymous) @ sketch.js:20
So probably the dollar signs is something that's not working in the browser;
var instagramData = {
instaToken: 'mytoken',
instaID: 'myid',
init: function(){
$.fn.spectragram.accesData = {
accessToken: this.instaToken,
clientID: this.instaID
};
$('.feed').spectragram('getUserFeed',{
max: 12,
query: 'Danielshiffman',
wrapEachWith: '<div class="photo">'
});
}
}
instagramData.init();
Answers
Hi I tried to simplify things by just trying the Jquery example and later adding the p5js stuff. Taking it step by step.
Now I did the jQuery example, but I get nothing no errors even. So I think the code is formatted correctly, but the console.log() (that I learned from p5js) doesn't output me anything to see what is working in the back ground. I queried everything from $ to 'div' to getPopular.
Is there something I'm overseeing as newbie? :\">
<!DOCTYPE html>
isn't placed at the 1st line.<script defer src=sketch.js></script>
This works, although no images are shown. But thats beyond the scope of this question. I get the response from the console.
Error: Spectragram.js - Error: the tag converse does not have results.
So there is probably some authentication thingy's floating in the air. I asked the spectagram github for more information on this. will report back if/when fixed.
Thanks again @GoToLoop
https://GitHub.com/adrianengine/jquery-spectragram/issues/61