A Dart library for parsing RSS feeds.


import 'package:feedparser/feedparser.dart';

void main() {
  Feed feed = parse(r'''
    <?xml version="1.0" encoding="UTF-8"?>
    <rss version="2.0">
        <title>Hello World!</title>      
        <description>Parse RSS feeds in Dart with feedparser</description>


  // Output:
  //    title: Hello World!
  //    link: null
  //    description: Parse RSS feeds in Dart with feedparser
  //    language: null
  //    copyright: null
  //    pubDate: null
  //    lastBuildDate: null
  //    image: null
  //    items: []

Strict mode

As long as the input string provided is a valid XML string, feedparser will attempt to parse it and return a Feed object. In strict mode feedparser instead throws ArgumentErrors for missing mandatory fields [as defined by the RSS 2.0 spec]. This is useful for testing feeds to ensure they meet the spec, but impractical when dealing with feeds not under your control.

  Feed feed = parse(xmlString, strict: true);