kolbyjack / MMM-Wallpaper

MagicMirror module to display wallpapers from various online sources
https://magicmirror.builders/
MIT License
99 stars 31 forks source link

syntax errors #68

Closed notoriousNichie closed 2 years ago

notoriousNichie commented 2 years ago

when I run the command "npm run config:check", I receive: pi@raspberrypi:~/MagicMirror $ npm run config:check

magicmirror@2.19.0 config:check node js/check_config.js

[13.04.2022 17:41.21.418] [INFO] Checking file... /home/pi/MagicMirror/config/config.js [13.04.2022 17:41.21.467] [ERROR] Your configuration file contains syntax errors :( [13.04.2022 17:41.21.468] [ERROR] Line 79 column 1: Parsing error: Unexpected token module

my current config.js is: //* MagicMirror\u00b2 Config Sample

let config = { address: "localhost", // Address to listen on, can be: // - "localhost", "127.0.0.1", "::1" to listen on loopback interface // - another specific IPv4/6 to listen on a specific interface // - "0.0.0.0", "::" to listen on any interface // Default, when address config is left out or empty, is "localhost" port: 8080, basePath: "/", // The URL path where MagicMirror\u00b2 is hosted. If you are using a Reverse proxy // you must set the sub path here. basePath must end with a / ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], // Set [] to allow all IP addresses // or add a specific IPv4 of 192.168.1.5 : // ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.1.5"], // or IPv4 range of 192.168.3.0 --> 192.168.3.15 use CIDR format : // ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.3.0/28"],

useHttps: false,        // Support HTTPS or not, default "false" will use HTTP
httpsPrivateKey: "",    // HTTPS private key path, only require when useHttps is true
httpsCertificate: "",   // HTTPS Certificate path, only require when useHttps is true

language: "en",
locale: "en-US",
logLevel: ["INFO", "LOG", "WARN", "ERROR"], // Add "DEBUG" for even more logging
timeFormat: 24,
units: "metric",
// serverOnly:  true/false/"local" ,
// local for armv6l processors, default
//   starts serveronly and then starts chrome browser
// false, default for all NON-armv6l devices
// true, force serveronly mode, because you want to.. no UI on this device

modules: [
    {
        module: "alert",
    },
    {
        module: "updatenotification",
        position: "top_bar"
    },
    {
        module: "clock",
        position: "top_left"
    },
    {
        module: "calendar",
        header: "US Holidays",
        position: "top_left",
        config: {
            calendars: [
                {
                    symbol: "calendar-check",
                    url: "webcal://www.calendarlabs.com/ical-calendar/ics/76/US_Holidays.ics"
                }
            ]
        }
    },
    {
        module: "compliments",
        position: "lower_third"
    },

    [
 {
        module: 'MMM-horoscope',
        position: 'middle_center',  // This can be any of the regions.

            config: {
        // See 'Configuration options' for additional options and more information.
        sign: 'aquarius', // Zodiac sign
        maxWidth: "400px", // maximum width of the module in px, %, em
        updateInterval: 1 * 60 * 60 * 1000, // updates every hour
        useTextIcon: true,
        initialLoadDelay: 0,
        animationSpeed: 2000,
   }
 }
]

modules: [ { module: "MMM-Wallpaper", position: "fullscreen_below", config: { // See "Configuration options" for more information. source: "http(s)://www.icloud.com/sharedalbum/#B0p5UzI7VEutng>", slideInterval: 60 * 1000 // Change slides every minute } } ]

    {
        module: "weather",
        position: "top_right",
        header: "Weather Forecast",
        config: {
            weatherProvider: "openweathermap",
            type: "forecast",
            location: "Birmingham",
            locationID: "4049979", //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city
            apiKey: "https://api.openweathermap.org/data/2.5/weather?zip=35064,us&appid=0902e3c19914fa6022959c47ccf48dab"
        }
    },
    {
        module: "newsfeed",
        position: "bottom_bar",
        config: {
            feeds: [
                {
                    title: "New York Times",
                    url: "https://rss.nytimes.com/services/xml/rss/nyt/HomePage.xml"
                }
            ],
            showSourceTitle: true,
            showPublishDate: true,
            broadcastNewsFeeds: true,
            broadcastNewsUpdates: true
        }
    },
]

};

/ DO NOT EDIT THE LINE BELOW / if (typeof module !== "undefined") {module.exports = config;}

kolbyjack commented 2 years ago

You're already in the modules array, and then you're starting it again. You want something like this:

//* MagicMirror\u00b2 Config Sample
let config = {
    address: "localhost", // Address to listen on, can be:
    // - "localhost", "127.0.0.1", "::1" to listen on loopback interface
    // - another specific IPv4/6 to listen on a specific interface
    // - "0.0.0.0", "::" to listen on any interface
    // Default, when address config is left out or empty, is "localhost"
    port: 8080,
    basePath: "/", // The URL path where MagicMirror\u00b2 is hosted. If you are using a Reverse proxy
    // you must set the sub path here. basePath must end with a /
    ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], // Set [] to allow all IP addresses
    // or add a specific IPv4 of 192.168.1.5 :
    // ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.1.5"],
    // or IPv4 range of 192.168.3.0 --> 192.168.3.15 use CIDR format :
    // ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.3.0/28"],

    useHttps: false, // Support HTTPS or not, default "false" will use HTTP
    httpsPrivateKey: "", // HTTPS private key path, only require when useHttps is true
    httpsCertificate: "", // HTTPS Certificate path, only require when useHttps is true

    language: "en",
    locale: "en-US",
    logLevel: ["INFO", "LOG", "WARN", "ERROR"], // Add "DEBUG" for even more logging
    timeFormat: 24,
    units: "metric",
    // serverOnly:  true/false/"local" ,
    // local for armv6l processors, default
    //   starts serveronly and then starts chrome browser
    // false, default for all NON-armv6l devices
    // true, force serveronly mode, because you want to.. no UI on this device

    modules: [
        {
            module: "alert",
        },
        {
            module: "updatenotification",
            position: "top_bar"
        },
        {
            module: "clock",
            position: "top_left"
        },
        {
            module: "calendar",
            header: "US Holidays",
            position: "top_left",
            config: {
                calendars: [{
                    symbol: "calendar-check",
                    url: "webcal://www.calendarlabs.com/ical-calendar/ics/76/US_Holidays.ics"
                }]
            }
        },
        {
            module: "compliments",
            position: "lower_third"
        },
        {
            module: 'MMM-horoscope',
            position: 'middle_center', // This can be any of the regions.
            config: {
                // See 'Configuration options' for additional options and more information.
                sign: 'aquarius', // Zodiac sign
                maxWidth: "400px", // maximum width of the module in px, %, em
                updateInterval: 1 * 60 * 60 * 1000, // updates every hour
                useTextIcon: true,
                initialLoadDelay: 0,
                animationSpeed: 2000,
            }
        },
        {
            module: "MMM-Wallpaper",
            position: "fullscreen_below",
            config: { // See "Configuration options" for more information.
                source: "icloud:B0p5Uzl7VEutng",
                slideInterval: 60 * 1000 // Change slides every minute
            }
        },
        {
            module: "weather",
            position: "top_right",
            header: "Weather Forecast",
            config: {
                weatherProvider: "openweathermap",
                type: "forecast",
                location: "Birmingham",
                locationID: "4049979", //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city
                apiKey: "https://api.openweathermap.org/data/2.5/weather?zip=35064,us&appid=0902e3c19914fa6022959c47ccf48dab"
            }
        },
        {
            module: "newsfeed",
            position: "bottom_bar",
            config: {
                feeds: [{
                    title: "New York Times",
                    url: "https://rss.nytimes.com/services/xml/rss/nyt/HomePage.xml"
                }],
                showSourceTitle: true,
                showPublishDate: true,
                broadcastNewsFeeds: true,
                broadcastNewsUpdates: true
            }
        },
    ]
};

/*************** DO NOT EDIT THE LINE BELOW ***************/
if (typeof module !== "undefined") {
    module.exports = config;
}
kolbyjack commented 2 years ago

There are online tools like https://jshint.com/ where you can paste your config, and they will try to help you figure out what's wrong.

notoriousNichie commented 2 years ago

@kolbyjack my backgtound is still black after the changes... Am i missing something?

kolbyjack commented 2 years ago

Is your iCloud album marked public? The module only works with public albums.

notoriousNichie commented 2 years ago

Yes & the public link is https://www.icloud.com/sharedalbum/#B0p5Uzl7VEutng

kolbyjack commented 2 years ago

It appears that apple has changed the way that newer albums need to be requested. I'll see if I can figure it out.

kolbyjack commented 2 years ago

Ok, try latest, it should work now.

notoriousNichie commented 2 years ago

I update the module in the cmd & it is still black ![Uploading image.jpg…]()

kolbyjack commented 2 years ago

Oh wait! There was another issue with your config. Your album id is B0p5Uzl7VEutng (with a lowercase l), but you have it in your config as B0p5UzI7VEutng (with an uppercase I)

notoriousNichie commented 2 years ago

It works!! 😊 thank you