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

Newsfeed, how to get url via API

Scheduled Pinned Locked Moved Productivity
5 Posts 2 Posters 826 Views 2 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
    selyjohns
    last edited by Jan 21, 2022, 6:00 PM

    Hello,
    I want to add a button on my magicmirror that send the URL of the current article to my smartphone.
    For this, I just need to retrieve the url and jeedom will do the notification to our smartphone.

    I think i need to use API request because newsfeed support notification mechanism.

    I’ve tried to do this with this simple request
    http://X.X.X.X:8080/api/notification/ARTICLE_INFO_REQUEST?apiKey=***

    But the result have empty payload.
    Any idea to get the URL of current article through API request ?
    Thank you :) !

    S 2 Replies Last reply Jan 21, 2022, 7:02 PM Reply Quote 0
    • S Offline
      sdetweil @selyjohns
      last edited by Jan 21, 2022, 7:02 PM

      @selyjohns the code doesn’t support getting A particular entry, only the CURRENT entry
      and url comes back as part of the response

      the newsfeed module code

      else if (notification === "ARTICLE_INFO_REQUEST") {
      			this.sendNotification("ARTICLE_INFO_RESPONSE", {
      				title: this.newsItems[this.activeItem].title,
      				source: this.newsItems[this.activeItem].sourceTitle,
      				date: this.newsItems[this.activeItem].pubdate,
      				desc: this.newsItems[this.activeItem].description,
      				url: this.getActiveItemURL()
      			});
      

      u are looking for

      “ARTICLE_INFO_RESPONSE” notification, right.

      the notification call is not synchronous…

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      S 1 Reply Last reply Jan 21, 2022, 11:00 PM Reply Quote 0
      • S Offline
        selyjohns @sdetweil
        last edited by selyjohns Jan 21, 2022, 11:08 PM Jan 21, 2022, 11:00 PM

        @sdetweil
        Thank you for your reply.
        I just want the url of current displayed article, and get it in my jeedom.

        do you see any solution to do that if I can’t by API ?

        Edit : tried with same request but RESPONSE instead of REQUEST and payload is still empty…I think I didn’t use it correctly.

        1 Reply Last reply Reply Quote 1
        • S Offline
          sdetweil @selyjohns
          last edited by Jan 22, 2022, 1:12 PM

          @selyjohns I do not know how u get response from that url request.

          looking at the remote-control code, there is no mechanism to get the response of a notification

          notifications are one way broadcasts to all modules

          send and forget

          A module MAY send back it’s OWN broadcast notification in response, as in the case of the notification u sent, newsfeed sends a notification back later

          but remote-control is not looking for it, nor waiting for it to complete the url request

          all the code does is send. and the url request is complete.

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          S 1 Reply Last reply Jan 22, 2022, 5:59 PM Reply Quote 0
          • S Offline
            selyjohns @sdetweil
            last edited by Jan 22, 2022, 5:59 PM

            @sdetweil Ok so no solution for what i want to do. The only solution is to display full article by API request, or use the MMM-News-QR to get URL.

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