• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
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.

DailyXKCD

Scheduled Pinned Locked Moved Entertainment
15 Posts 5 Posters 12.4k Views 8 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.
  • S Offline
    strawberry 3.141 Project Sponsor Module Developer
    last edited by Jul 13, 2016, 4:52 PM

    for inverting the colours you can insert the css rule filter: invert(100%);

    Please create a github issue if you need help, so I can keep track

    B 1 Reply Last reply Jul 14, 2016, 1:27 PM Reply Quote 2
    • P Offline
      paviro Admin
      last edited by Jul 14, 2016, 10:22 AM

      Maybe add it as an option to the module? I think lots of people would like that!

      We're all stories in the end. Just make it a good one, eh?

      – The Doctor

      1 Reply Last reply Reply Quote 0
      • B Offline
        Blastitt @strawberry 3.141
        last edited by Blastitt Jul 14, 2016, 1:36 PM Jul 14, 2016, 1:27 PM

        @strawberry-3.141 @paviro

        I added an option to invert the colors and dev console shows the image has the style filter : invert(100%); but the colors don’t seem to be inverting at all.

        Update: Changed to -webkit-filter and it worked. Looks hella good.

        1 Reply Last reply Reply Quote 0
        • B Offline
          Blastitt @Blastitt
          last edited by Jul 14, 2016, 1:38 PM

          This post is deleted!
          1 Reply Last reply Reply Quote 0
          • R Offline
            RedNax Module Developer
            last edited by Jul 18, 2016, 6:06 AM

            Hi!

            Since new comics only come out on monday, wednesday and friday i made a slight modification (ugly hack) to your node_helper.js…

            On non comic days, after getting the current comic, the node_helper will examines the num value and generate a random number between 1 and said value. It will then get the random comic and return it in the payload.

            	socketNotificationReceived: function(notification, payload) {
            		var self = this;
            		console.log("Notification: " + notification + " Payload: " + payload);
            		
            		if(notification === "GET_COMIC"){
            			
            			var comicJsonUri = payload.config.dailyJsonUrl;
            			var comic;
            			var rndcomic;
            			var rndUrl;
            			var body;
            			var d = new Date();
            			var n = d.getDay(); 
            			
            			request(comicJsonUri, function (error, response, body) {
            				if (!error && response.statusCode == 200) {
            					console.log(body);
            					if ( this.n == 1 || this.n == 3 || this.n == 5 ) {
            							self.sendSocketNotification("COMIC", JSON.parse(body));
            					} else {
            						this.comic = JSON.parse(body); 
            						this.rndcomic = Math.floor((Math.random() * this.comic.num) + 1); 
            						this.rndUrl = "http://xkcd.com/" + this.rndcomic + "/info.0.json";
            						request(this.rndUrl, function (error, response, body) {
            							if (!error && response.statusCode == 200) {
            								console.log(body);
            								self.sendSocketNotification("COMIC", JSON.parse(body));
            							}
            						});
            					}
            				}
            			});
            		}
            	},
            
            B 1 Reply Last reply Jul 18, 2016, 11:05 PM Reply Quote 2
            • B Offline
              Blastitt @RedNax
              last edited by Jul 18, 2016, 11:05 PM

              @RedNax

              I like it! Put in a pull request if you want it in the official repo. Also maybe add a config option to turn the feature off (if someone just wants to see new comics only)?

              1 Reply Last reply Reply Quote 0
              • M Offline
                mav29x
                last edited by Jul 19, 2016, 7:36 PM

                This is awesome! Thanks for making this!!

                1 Reply Last reply Reply Quote 1
                • N Offline
                  Nexxic
                  last edited by Oct 20, 2016, 4:15 PM

                  Beautiful little module! I was wondering though, is it possible to adjust the size of the comic? I found it quite big for my mirror. Also, did @RedNax modification get into the module? Tried to just copy-paste it, but didn’t get it to work… (Hope I’m posting in the correct thread for this :P)

                  B 1 Reply Last reply Oct 20, 2016, 8:06 PM Reply Quote 0
                  • B Offline
                    Blastitt @Nexxic
                    last edited by Oct 20, 2016, 8:06 PM

                    @Nexxic In the only pull request made, the author retracted it. I’ve had a couple people say they were working on a pull request for fixing the size of the larger comics, but nothing’s come of it yet. I’m too busy at the moment, otherwise I would do it myself.

                    J 1 Reply Last reply Oct 25, 2016, 9:18 PM Reply Quote 0
                    • R Offline
                      RedNax Module Developer
                      last edited by Oct 21, 2016, 6:37 AM

                      Submitted another pull request just now…

                      1 Reply Last reply Reply Quote 0
                      • 1
                      • 2
                      • 1 / 2
                      • 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