MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    MMM-Instagram - Pull and animate photos from Instagram feed

    Scheduled Pinned Locked Moved Utilities
    87 Posts 26 Posters 114.7k Views 27 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D Offline
      Diicken
      last edited by

      Is there anyway to display images from my home server? And do someone have an idea how I should write the code?

      1 Reply Last reply Reply Quote 0
      • yo-lessY Offline
        yo-less Module Developer @dr0pb0x
        last edited by

        @dr0pb0x Anything is possible, but I doubt it. Please have @kapsolas help you with this, as I don’t have any direct way of testing it. As far as I’m concerned my code adjustments should work.

        1 Reply Last reply Reply Quote 0
        • MichMichM Offline
          MichMich
          last edited by

          Awesome work! My SO is very pleased with this idea. You might want to add a screenshot to the repo.

          1 Reply Last reply Reply Quote 0
          • ? Offline
            A Former User
            last edited by

            Just getting “Loading…”

            1 Reply Last reply Reply Quote 0
            • cowboysdudeC Offline
              cowboysdude Module Developer
              last edited by cowboysdude

              This post is deleted!
              ? 1 Reply Last reply Reply Quote 0
              • ? Offline
                A Former User @cowboysdude
                last edited by

                @cowboysdude said in MMM-Instagram - Pull and animate photos from Instagram feed:

                @kapsolas

                Some of us are having issues here… little help please.

                Installed per instructions with NPM Install and it isn’t working.

                That’s all mine says too… “Loading…”

                apparently this is an unsupported module… delete.

                1 Reply Last reply Reply Quote 0
                • K Offline
                  kapsolas Module Developer
                  last edited by

                  I just started up my mirror again and the instagram module loaded up correctly.

                  Are you use that you have configured the token correctly?

                  Additionally, install a tool like firebug on your browser and try to access the mirror using the browser. Then enable firebug. It will have error messages or plugin messages written to the console.

                  If the plugin gets images and starts to display them, you will get console entries such as: incrementing the activeItem and refreshing

                  1 Reply Last reply Reply Quote 0
                  • cowboysdudeC Offline
                    cowboysdude Module Developer
                    last edited by

                    Well we’re certainly glad it worked for you…however…

                    {
                    module: ‘MMM-Instagram’,
                    position: ‘top_right’,
                    config: {
                    access_token: ‘API_KEY from instagram’,
                    count: 200,
                    min_timestamp: 0,
                    animationSpeed: 2500,
                    updateInterval: 12500
                    }
                    },

                    Replaced ‘API_KEY …’

                    and followed all directions and it still sits there and says “Loading…”…

                    ? 1 Reply Last reply Reply Quote 0
                    • ? Offline
                      A Former User @cowboysdude
                      last edited by

                      @cowboysdude said in MMM-Instagram - Pull and animate photos from Instagram feed:

                      Well we’re certainly glad it worked for you…however…

                      {
                      module: ‘MMM-Instagram’,
                      position: ‘top_right’,
                      config: {
                      access_token: ‘API_KEY from instagram’,
                      count: 200,
                      min_timestamp: 0,
                      animationSpeed: 2500,
                      updateInterval: 12500
                      }
                      },

                      Replaced ‘API_KEY …’

                      and followed all directions and it still sits there and says “Loading…”…

                      Same

                      1 Reply Last reply Reply Quote 0
                      • K Offline
                        kapsolas Module Developer
                        last edited by

                        What are you guys seeing in the console log? If you are not anything… then I will have to send you a version of the module with debug comments in it to see where the issue is.

                        FYI - I had a similar issue with the Module for Traffic and never solved it. It just sat on Loading…

                        cowboysdudeC 1 Reply Last reply Reply Quote 1
                        • cowboysdudeC Offline
                          cowboysdude Module Developer @kapsolas
                          last edited by cowboysdude

                          @kapsolas Well gosh darn it LOL SOLVE IT MAN! Lives are hangin in the balance…

                          No I have run it in dev mode and I see or get no errors… so perhaps using a version with debug would be best :)

                          1 Reply Last reply Reply Quote 0
                          • cowboysdudeC Offline
                            cowboysdude Module Developer
                            last edited by

                            OH I stand corrected… here’s an error:

                            0_1477525313189_IMG_1938-min__1477525285_74.69.130.112.jpg

                            1 Reply Last reply Reply Quote 0
                            • ? Offline
                              A Former User
                              last edited by

                              How do you get it to show in a browser??

                              cowboysdudeC 1 Reply Last reply Reply Quote 0
                              • cowboysdudeC Offline
                                cowboysdude Module Developer @Guest
                                last edited by

                                @wjdw87 said in MMM-Instagram - Pull and animate photos from Instagram feed:

                                How do you get it to show in a browser??

                                restart your mirror like this:

                                npm start dev

                                1 Reply Last reply Reply Quote 0
                                • ? Offline
                                  A Former User
                                  last edited by

                                  cool thanks

                                  cowboysdudeC 1 Reply Last reply Reply Quote 0
                                  • cowboysdudeC Offline
                                    cowboysdude Module Developer @Guest
                                    last edited by

                                    @wjdw87 You’re welcome :) NOW if he can solve the problem it’ll work! :)

                                    1 Reply Last reply Reply Quote 0
                                    • K Offline
                                      kapsolas Module Developer
                                      last edited by

                                      Hmm. that tempimpage variable is not found in my code.

                                      Did you modify the code at all? The code should look as below. In the error message it shows tempimpage which is not a valid variable. This would cause the script to not work.

                                         var tempimage = this.images.photo[this.activeItem];
                                          
                                          // image
                                          var imageLink = document.createElement('div');
                                          imageLink.id = "MMM-Instagram-image";
                                          imageLink.innerHTML = "<img src='" + tempimage.photolink + "'>";
                                          
                                          imageDisplay.appendChild(imageLink);
                                          wrapper.appendChild(imageDisplay);
                                      
                                      cowboysdudeC ? 2 Replies Last reply Reply Quote 0
                                      • cowboysdudeC Offline
                                        cowboysdude Module Developer @kapsolas
                                        last edited by cowboysdude

                                        @kapsolas no didn’t modify. So what I’ll do is delete what’s there and recopy it since I already did the npm install.

                                        Thank you!! 😊

                                        1 Reply Last reply Reply Quote 0
                                        • ? Offline
                                          A Former User @kapsolas
                                          last edited by

                                          @kapsolas Where is this “added code” that needs to be removed, sorry missed that.

                                          1 Reply Last reply Reply Quote 0
                                          • ? Offline
                                            A Former User
                                            last edited by A Former User

                                            Remove " + tempimage.photolink + “'>”" ?

                                            /* global Module */

                                            /* Magic Mirror

                                            • Module: MMM-Instagram
                                            • By Jim Kapsalis https://github.com/kapsolas
                                            • MIT Licensed.
                                              */

                                            Module.register(‘MMM-Instagram’, {

                                            defaults: {
                                                format: 'json',
                                                lang: 'en-us',
                                                id: '',
                                                animationSpeed: 1000,
                                                updateInterval: 60000, // 10 minutes
                                                access_token: '',
                                                count: 200,
                                                min_timestamp: 0,
                                                loadingText: 'Loading...'
                                            },
                                            
                                            // Define required scripts
                                            getScripts: function() {
                                                return ["moment.js"];
                                            },
                                            
                                            /*
                                            // Define required translations
                                            getTranslations: function() {
                                                return false;
                                            },
                                            */
                                            
                                            // Define start sequence
                                            start: function() {
                                                Log.info('Starting module: ' + this.name);
                                                this.data.classes = 'bright medium';
                                                this.loaded = false;
                                                this.images = {};
                                                this.activeItem = 0;
                                                this.url = 'https://api.instagram.com/v1/users/self/media/recent' + this.getParams();
                                                this.grabPhotos();
                                            },
                                            
                                            grabPhotos: function() {
                                                // the notifications are not working for some reason... so we won't do anything asynchronously
                                                // we will just make the call to the method to get the object with photo links....
                                                //Log.info('sending socket notification: INSTAGRAM_GET and URL: ' + this.url);
                                                this.sendSocketNotification("INSTAGRAM_GET", this.url);
                                                
                                                // this may not be needed... need to think about it.
                                                //setTimeout(this.grabPhotos, this.config.interval, this);
                                            },
                                            
                                            
                                            getStyles: function() {
                                                return ['instagram.css', 'font-awesome.css'];
                                            },
                                            
                                            // Override the dom generator
                                            getDom: function() {
                                                var wrapper = document.createElement("div");
                                                var imageDisplay = document.createElement('div'); //support for config.changeColor
                                            
                                                if (!this.loaded) {
                                                    wrapper.innerHTML = this.config.loadingText;
                                                    return wrapper;
                                                }
                                                
                                                // set the first item in the list...
                                                if (this.activeItem >= this.images.photo.length) {
                                                    this.activeItem = 0;
                                                }
                                                
                                                var tempimage = this.images.photo[this.activeItem];
                                                
                                                // image
                                            	var imageLink = document.createElement('div');
                                            		imageLink.id = "MMM-Instagram-image";
                                            		imageLink.innerHTML = "<img src='" + tempimage.photolink + "'>";
                                            
                                            		imageDisplay.appendChild(imageLink);
                                            		wrapper.appendChild(imageDisplay);
                                               
                                                return wrapper;
                                            },
                                            
                                            /* scheduleUpdateInterval()
                                             * Schedule visual update.
                                             */
                                            scheduleUpdateInterval: function() {
                                                var self = this;
                                            
                                                Log.info("Scheduled update interval set up...");
                                                self.updateDom(self.config.animationSpeed);
                                            
                                                setInterval(function() {
                                                    Log.info("incrementing the activeItem and refreshing");
                                                    self.activeItem++;
                                                    self.updateDom(self.config.animationSpeed);
                                                }, this.config.updateInterval);
                                            },
                                            
                                            /*
                                             * getParams()
                                             * returns the query string required for the request to flickr to get the 
                                             * photo stream of the user requested
                                             */
                                            getParams: function() {
                                                var params = '?';
                                                params += 'count=' + this.config.count;
                                                params += '&min_timestamp=' + this.config.min_timestamp;
                                                params += '&access_token=' + this.config.access_token;
                                                return params;
                                            },
                                            
                                            // override socketNotificationReceived
                                            socketNotificationReceived: function(notification, payload) {
                                                //Log.info('socketNotificationReceived: ' + notification);
                                                if (notification === 'INSTAGRAM_IMAGE_LIST')
                                                {
                                                    //Log.info('received INSTAGRAM_IMAGE_LIST');
                                                    this.images = payload;
                                                    
                                                    //Log.info("count: " +  this.images.photo.length);
                                                    
                                                    // we want to update the dom the first time and then schedule next updates
                                                    if (!this.loaded) {
                                                    this.updateDom(1000);
                                                        this.scheduleUpdateInterval();
                                                    }
                                                    
                                                    this.loaded = true;
                                                }
                                            }
                                            

                                            });

                                            1 Reply Last reply Reply Quote 0

                                            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                            With your input, this post could be even better 💗

                                            Register Login
                                            • 1
                                            • 2
                                            • 3
                                            • 4
                                            • 5
                                            • 5 / 5
                                            • First post
                                              Last post
                                            Enjoying MagicMirror? Please consider a donation!
                                            MagicMirror created by Michael Teeuw.
                                            Forum managed by Sam, technical setup by Karsten.
                                            This forum is using NodeBB as its core | Contributors
                                            Contact | Privacy Policy