Read the statement by Michael Teeuw here.
Help getting remote compliments working
-
@robertybob the error is in the actual compliments.js file, did u edit that file?
home/pi/MagicMirror/modules/default/compliments/compliments.js:9
never edit the module files
-
@robertybob u cannot access a file on GitHub like that
-
@sdetweil Oh I see, do I need to save that file within the module’s folder and point it to that?
-
@robertybob correct
-
@sdetweil Sorry about that, I didn’t realise I wasn’t supposed to edit the .js files within the modules folders, I’ve restored the original compliments.js file.
My code within config.js now reads:
{ module: 'compliments', position: 'middle_center', config: { remoteFile: '/home/pi/MagicMirror/modules/default/compliments/remote_compliments.js' } },however now only the default compliments are shown on the screen
-
@robertybob the doc says
remoteFilePath or URL (starting with http:// or https://) to a JSON file containing compliments,
so. the file needs either the file prefix
file://
or the http prefix, assuming the server root
the server root is /home/pi/MagicMirror
so
http://localhost:8080/modules/default/compliments/compliments.jsonjson(json) and JavaScript(js) are like each other, but not the same.
I would put your json file thru one of the online parsers to make sure it’s right, and then use the correct file extension -
@robertybob actually, looking at it again, your GitHub url should work. if u put that in a browser it downloads a file
but u need to use the raw link
remoteFile:‘https://raw.githubusercontent.com/robertybob/MagicMirrorConfigs/master/compliments.json’and i put it thru an online validator and the contents look good
-
@sdetweil Thank you so much! I spotted a missing comma a few minutes ago, which I’ve now corrected. The raw link works perfectly. Thank you so so much!!!
-
@robertybob awesome!!
I use this validator, just FYI.
https://codebeautify.org/jsonvalidator -
@sdetweil I’ve submitted a pull request on the documentation repository so that hopefully no one will require assistance on this in the future ;)
-
@robertybob awesome!
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