MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord

    Get URL from Newsfeed (full article)

    Development
    2
    4
    1550
    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
      Sennahoj82 last edited by

      How do I get the url of the full article of the shown newsfeed?
      With

      var title = this.newsItems[this.activeItem].title;
      

      I get the headline of the newsfeed.

      With

      var description = this.newsItems[this.activeItem].description;
      

      I get the description of the newsfeed.

      But

      var url = this.newsItems[this.activeItem].url;
      

      does not show anything.

      With this URL I want to open the full article of the newsfeed. What do I wrong?

      Greetings from Thuringia/Germany

      1 Reply Last reply Reply Quote 0
      • yawns
        yawns Moderator last edited by

        Which newsfeed are you using? Did you open your newsfeed in a browser to see if there is an entry with url or link?

        fetcher.js does this:

        var url = item.url || item.link || "";
        

        So if you use the default news feed http://rss.nytimes.com/services/xml/rss/nyt/HomePage.xml you see there is an entry link as a child node of item. Maybe your newsfeed uses something other than url or link?

        1 Reply Last reply Reply Quote 0
        • S
          Sennahoj82 last edited by

          Hi yawns.

          I am using these newsfeeds http://www.tagesschau.de/xml/rss2 and https://thib24.de/feed.
          I see no difference between the default newsfeed and my.

          So I myself have tried the default newsfeed and it also won’t work.

          If I put out the url to log information

          var url = this.newsitems[this.activeItem].url;
          Log.info("Article_URL " + url);
          

          the browser provide this information: Article_URL undefined.

          1 Reply Last reply Reply Quote 0
          • S
            Sennahoj82 last edited by

            Ok.

            I’ve solved the problem. There wasn’t a url decleration in my fetcher.js.
            I put it in to the fetcher.js an it works very well now.
            Thanks for your help.

            Great forum.

            Greetings from Thuringia/Germany

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            • First post
              Last post
            Enjoying MagicMirror? Please consider a donation!
            MagicMirror created by Michael Teeuw.
            Forum managed by Paul-Vincent Roll and Rodrigo Ramírez Norambuena.
            This forum is using NodeBB as its core | Contributors
            Contact | Privacy Policy