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

    Function detectFormat

    • Detect feed format from content string.

      Parameters

      • content: string

        Feed content as string

      Returns FeedFormat

      Detected format or 'unknown' if format cannot be determined

      Analyzes the content to determine if it's RSS, Atom, or JSON Feed. Detection is based on root elements, namespaces, and structure.

      Detection priority:

      1. JSON Feed (checks for JSON with jsonfeed.org version)
      2. RSS (checks for <rss> or <rdf:RDF> root elements)
      3. Atom (checks for <feed> root element with Atom namespace)
      const format = detectFormat(feedContent);
      if (format === 'rss') {
      console.log('This is an RSS feed');
      }