Magpie HTML - v0.2.2
    Preparing search index...

    Function gatherFeed

    • Gather and parse a feed from a URL in one convenient call.

      Parameters

      • url: string | URL

        Feed URL as string or URL object

      Returns Promise<Feed>

      Normalized feed data

      This is a high-level convenience method that combines fetching and parsing. It handles encoding detection, redirects, and feed format detection automatically. Falls back to sitemap parsing when standard feed formats aren't detected.

      Error if URL is invalid, fetch fails, or feed cannot be parsed

      // Fetch and parse a feed
      const feed = await gatherFeed('https://example.com/feed.xml');

      console.log(feed.title);
      console.log(feed.items[0].title);
      console.log(feed.items[0].url);