• 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.

Need more compliments? compliments.json

Scheduled Pinned Locked Moved Fun & Games
16 Posts 8 Posters 9.7k 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.
  • G Offline
    gotchabeats
    last edited by Jul 11, 2019, 5:13 PM

    i still cant figure it out. How do i remote to the file?

    S 1 Reply Last reply Jul 11, 2019, 9:52 PM Reply Quote 0
    • S Offline
      sdetweil @gotchabeats
      last edited by Jul 11, 2019, 9:52 PM

      @gotchabeats you don’t its just a word…

      means the compliments are the file, not in config.js

      just

      {
      module: 'compliments',
         config: { 
           remoteFile: 'whatever the filename is',
         ...
         ...
         }
      },
      

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      1 Reply Last reply Reply Quote 1
      • G Offline
        gotchabeats
        last edited by Jul 11, 2019, 10:11 PM

        @sdetweil said in compliments.json:

        @gotchabeats you don’t its just a word…

        means the compliments are the file, not in config.js

        just

        {
        module: 'compliments',
           config: { 
             remoteFile: 'whatever the filename is',
           ...
           ...
           }
        },
        

        thanks that worked

        1 Reply Last reply Reply Quote 0
        • A Offline
          amanzimdwini @ryck
          last edited by Aug 14, 2021, 10:01 PM

          @ryck
          I was wondering how I can just link to a LOCAL file (instead of your github): I’d like to change the contents.
          (Yes, I could copy to my OWN github and modify, but that seems a bit wierd).
          I have to date failed with

          remoteFile: "~\MagicMirror\config\compliments.json"
          

          where I had copied your file to.

          What am I missing?
          Thanks
          Karl

          R 1 Reply Last reply Aug 14, 2021, 11:19 PM Reply Quote 0
          • R Offline
            ryck Module Developer @amanzimdwini
            last edited by Aug 14, 2021, 11:19 PM

            @amanzimdwini I always use it locally, github is just a place for sharing it, so you are doing the right thing. You can always fork it to keep your personal compliments safe, but that’s up to you.

            To use it, copy the file to somewhere (ie, in the compliments module folder: modules/default/compliments/compliments.js) and use it in your config like this:

                {
                  module: "compliments",
                  position: "bottom_bar",
                  disabled: false,
                  config: {
                    remoteFile: "compliments.json",
                    updateInterval: 10000,
                    classes: "thin bright medium",
                    fadeSpeed: 2000,
                  },
                },
            

            Good luck!

            P A 2 Replies Last reply Aug 27, 2021, 1:40 PM Reply Quote 0
            • P Offline
              pastormingle @ryck
              last edited by Aug 27, 2021, 1:40 PM

              @ryck Do you know if compliments can be set to fit a grid? I have it at the top right about my todo list and when it rotates it causes the todo to also change in size?

              1 Reply Last reply Reply Quote 0
              • A Offline
                amanzimdwini @ryck
                last edited by Sep 10, 2021, 5:42 PM

                @ryck
                I am struggling with this… why am I dense?

                1. IF I use
                remoteFile="https://gist.githubusercontent.com/ryck/..."
                

                (ie just pointing at YOUR file online), THEN things work. (but this is what I did not like in the first post of mine)

                1. IF I copy your compliments.json into ~/MagicMirror/modules/default/compliments/compliments.json
                  like I read your response, and use
                remoteFile="compliments.json"
                

                THEN all I get are the “original” compliments.

                1. IF I replace (ouch!) the original compliments.js (your response could be read to imply that) with your compliments.json and use
                remoteFile="compliments.json"
                

                THEN I get no compliments at all (but at least no warnings either: that’s impressive).

                Right now, if I want to add my own compliments, all I can do use approach (1), but place your compliments.json into my own git, edit and point to that. Which seems awkward…

                Any help would be appreciated.

                S 1 Reply Last reply Sep 10, 2021, 7:55 PM Reply Quote 0
                • S Offline
                  sdetweil @amanzimdwini
                  last edited by sdetweil Sep 22, 2021, 2:59 PM Sep 10, 2021, 7:55 PM

                  @amanzimdwini the FILE, remote or local must be

                  {
                             "name":[" list of strings for name" ],
                              "name2": [ ]
                  }
                  

                  test that it is a valid JSON file using one of the online validators

                  and name can be one of morning, afternoon, evening and anytime.

                  and a cron time value

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  A 1 Reply Last reply Sep 13, 2021, 4:38 PM Reply Quote 0
                  • A Offline
                    amanzimdwini @sdetweil
                    last edited by Sep 13, 2021, 4:38 PM

                    @sdetweil
                    HERE is my config:

                    {
                            module: "compliments",
                            position: "lower_third",
                            config: {
                                    remoteFile: "https://gist.githubusercontent.com/ryck/e28a69665b8839f6e9a7acd6b4acc97d/raw/be1dee8f805a433f6ee0fa3556d1927da14e7799/compliments.json",
                    //              remoteFile: "compliments.json",
                    //              remoteFile: "~/MagicMirror/modules/default/compliments/compliments.json",
                                    },
                    },
                    
                    

                    All I do is un-comment the remoteFile lines one at a time to test -
                    and the lower two remoteFiles (that are commented out) DO NOT WORK even though the compliments.json file is the one I copied from Git…

                    I only want one (local) file; I’m not sure what I am doing wrong.

                    Thanks,
                    Karl

                    S 1 Reply Last reply Sep 13, 2021, 5:02 PM Reply Quote 0
                    • S Offline
                      sdetweil @amanzimdwini
                      last edited by Sep 13, 2021, 5:02 PM

                      @amanzimdwini when I do
                      the second one, “compliments.json”
                      (without a file)

                      I see error in console

                       http://0.0.0.0:8090/modules/default/compliments/compliments.json 404 (Not Found)
                      

                      if the file is empty I see

                      VM143:1 Uncaught SyntaxError: Unexpected end of JSON input
                          at JSON.parse (<anonymous>)
                          at compliments.js:44
                          at XMLHttpRequest.xobj.onreadystatechange (compliments.js:131)
                      

                      if I have a syntax error in the file contents I see

                      VM298:3 Uncaught SyntaxError: Unexpected string in JSON at position 42
                          at JSON.parse (<anonymous>)
                          at compliments.js:44
                          at XMLHttpRequest.xobj.onreadystatechange (compliments.js:131)
                      

                      if the file contains this content (changed from default text to insure it works)

                      {
                      			"anytime": ["Hey there sexy!"],
                      			"morning": ["Good morning, handsome!", "Enjoy your day!", "How was your sleep?"],
                      			"afternoon": ["Hello, you beauty!", "You look sexy!", "Looking good today!"],
                      			"evening": ["Wow, you look hot!", "You look nice!", "Hi, sexy!"],
                      			"....-01-01": ["Happy new year!"]
                      		}
                      

                      I see displayed

                                     Hello, you beauty!
                      

                      Sam

                      How to add modules

                      learning how to use browser developers window for css changes

                      A 1 Reply Last reply Sep 14, 2021, 10:55 PM 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