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

Show calendar based on IP Address accessed

Scheduled Pinned Locked Moved Development
68 Posts 3 Posters 19.9k Views 3 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
    Spinster @sdetweil
    last edited by May 7, 2024, 1:14 PM

    @sdetweil will express ipfilter be useful? Similar to whitelist, can we try something

    S 1 Reply Last reply May 7, 2024, 1:19 PM Reply Quote 0
    • S Online
      sdetweil @Spinster
      last edited by May 7, 2024, 1:19 PM

      @Spinster no… as its in the wrong place… (inside node_helper…) we NEED the ip address to compare with

      just get it and return . one time

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      1 Reply Last reply Reply Quote 0
      • S Online
        sdetweil @MMRIZE
        last edited by sdetweil May 7, 2024, 1:28 PM May 7, 2024, 1:22 PM

        @MMRIZE said in Show calendar based on IP Address accessed:

        (You don’t have to modify the original source code for future-proof.)

        BUT you are fetching cal for system not going to use it… SOME cals are 1000’s of entries especially old
        that have to be processed… this is a bad waste of resources…

        and this exposes a cal problem, as if u fetch http://xyz on client 1 and client 2 and client 3, we fetch it 3 times. also bad
        this could also lead to different clients showing different data between fetchIntervals…

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        M 2 Replies Last reply May 7, 2024, 1:28 PM Reply Quote 0
        • M Offline
          MMRIZE @sdetweil
          last edited by May 7, 2024, 1:28 PM

          @sdetweil said in Show calendar based on IP Address accessed:

          BUT you are fetching cal for system not going to use it… SOME cals are 1000’s of entries especially old
          that have to be processed… this is a bad waste of resources…

          I Can’t understand your point.
          My code is just small injection that does filtering out calendars by condition on socketNotificationReceived. No additional fetching is needed.

          S 1 Reply Last reply May 7, 2024, 1:41 PM Reply Quote 0
          • M Offline
            MMRIZE @sdetweil
            last edited by MMRIZE May 7, 2024, 1:39 PM May 7, 2024, 1:36 PM

            @sdetweil said in Show calendar based on IP Address accessed:

            @MMRIZE said in Show calendar based on IP Address accessed:

            (You don’t have to modify the original source code for future-proof.)

            BUT you are fetching cal for system not going to use it… SOME cals are 1000’s of entries especially old
            that have to be processed… this is a bad waste of resources…

            and this exposes a cal problem, as if u fetch http://xyz on client 1 and client 2 and client 3, we fetch it 3 times. also bad
            this could also lead to different clients showing different data between fetchIntervals…

            Well, if that is the issue, we need a new “calendar” module that can ignore duplicated feed on addCalendar.
            Regardless of my code, the original calendar module will fetch a same feed multiply on multi clients. It’s MM’s limitation.

            S 1 Reply Last reply May 7, 2024, 1:38 PM Reply Quote 0
            • S Online
              sdetweil @MMRIZE
              last edited by sdetweil May 7, 2024, 5:34 PM May 7, 2024, 1:38 PM

              @MMRIZE yes

              @Spinster

              see later post

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              S 1 Reply Last reply May 7, 2024, 1:57 PM Reply Quote 0
              • S Online
                sdetweil @MMRIZE
                last edited by May 7, 2024, 1:41 PM

                @MMRIZE said in Show calendar based on IP Address accessed:

                My code is just small injection that does filtering out calendars by condition on socketNotificationReceived. No additional fetching is needed.

                AFTER fetching… so throw away data, which we fetched , knowing we wouldn’t use it…

                Sam

                How to add modules

                learning how to use browser developers window for css changes

                M 1 Reply Last reply May 7, 2024, 1:57 PM Reply Quote 0
                • S Offline
                  Spinster @MMRIZE
                  last edited by May 7, 2024, 1:44 PM

                  @MMRIZE I tried it, but it is still showing the calendar even if there is no calendar defined for the ip. I edited only the config.js file and added your code. Modified the calendars to suite mine. I could see even if there is no calendar defined for a particular ip. Please advice

                  M 1 Reply Last reply May 7, 2024, 1:59 PM Reply Quote 0
                  • S Offline
                    Spinster @sdetweil
                    last edited by May 7, 2024, 1:57 PM

                    @sdetweil Is this working? Should I try it, please advice

                    S 1 Reply Last reply May 7, 2024, 2:01 PM Reply Quote 0
                    • M Offline
                      MMRIZE @sdetweil
                      last edited by MMRIZE May 7, 2024, 2:00 PM May 7, 2024, 1:57 PM

                      @sdetweil
                      Still I can’t catch you.

                      [2024-05-07 15:03:33.741] [LOG]   Use existing calendarfetcher for url: https://ics.calendarlabs.com/76/mm3137/US_Holidays.ics
                      

                      The log shows, duplicated URL would be integrated into existing fetcher, So unlike your words, 3 clients doesn’t make 3 duplicated wasted fetcher.

                      If clientA needs cal1, cal2, cal3 and clientB needs cal1, cal4, cal5. In this case server should fetch 5 calendars anyway. User may need cal1 ~ cal5 even on 1 screen or 2 screens, ther server’s burden would be the same.

                      The only aspect that could be considered a waste is the transmission of unusing event data for cal4 and cal5 to clientA, but unless it’s a performance issue with the data parsing algorithm, simply having large data size being transmitted isn’t particularly problematic. Moreover, since the data is dropped in my code as soon as the notification is received, it can’t be deemed a significant memory issue. If the data size itself becomes problematic, it implies there’s already a problem with the original calendar module using cal1, cal2, cal3, cal4, and cal5.

                      Too skeptic.

                      1 Reply Last reply Reply Quote 0
                      • 1
                      • 2
                      • 3
                      • 4
                      • 5
                      • 6
                      • 7
                      • 3 / 7
                      3 / 7
                      • First post
                        28/68
                        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