feedparser 0.0.2 copy "feedparser: ^0.0.2" to clipboard
feedparser: ^0.0.2 copied to clipboard

Dart 1 only

RSS feed parser.

feedparser #

pub package Build Status

A Dart library for parsing RSS feeds.

Usage #

import 'package:feedparser/feedparser.dart';

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

  print(feed);

  // 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);
1
likes
20
pub points
40%
popularity

Publisher

unverified uploader

RSS feed parser.

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

Dependencies

xml

More

Packages that depend on feedparser