Read the statement by Michael Teeuw here.
Newsfeed, how to get url via API
-
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 :) ! -
@selyjohns the code doesn’t support getting A particular entry, only the CURRENT entry
and url comes back as part of the responsethe 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…
-
@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.
-
@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.
-
@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.