webfeed 0.4.1

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 90

WebFeed

Build Status Pub

A dart package for parsing RSS and Atom feed. Supporting

Features

  • [x] RSS
  • [x] Atom
  • [x] Namespaces
    • [x] Media RSS
    • [x] Dublin Core

Installing

Add this line into your pubspec.yaml

webfeed: ^0.4.1

Import the package into your dart code using:

import 'package:webfeed/webfeed.dart';

Example

To parse string into RssFeed object use:

var rssFeed = new RssFeed.parse(xmlString); // for parsing RSS feed
var atomFeed = new AtomFeed.parse(xmlString); // for parsing Atom feed

Preview

RSS

feed.title
feed.description
feed.link
feed.author
feed.items
feed.image
feed.cloud
feed.categories
feed.skipDays
feed.skipHours
feed.lastBuildDate
feed.language
feed.generator
feed.copyright
feed.docs
feed.managingEditor
feed.rating
feed.webMaster
feed.ttl
feed.dc

RssItem item = feed.items.first;
item.title
item.description
item.link
item.categories
item.guid
item.pubDate
item.author
item.comments
item.source
item.media
item.enclosure
item.dc

Atom

feed.id
feed.title
feed.updated
feed.items
feed.links
feed.authors
feed.contributors
feed.categories
feed.generator
feed.icon
feed.logo
feed.rights
feed.subtitle

AtomItem item = feed.items.first;
item.id
item.title
item.updated
item.authors
item.links
item.categories
item.contributors
item.source
item.published
item.content
item.summary
item.rights
item.media

License

WebFeed is licensed under the MIT License - see the LICENSE.md file for details

Changelog

0.4.0

Added

  • Support author in RssFeed

0.4.0

Added

  • Support for dublin core namespace
  • Support enclosure in rss item
  • Set minimum dart version into 2

0.3.0

Added

  • Support for image namespace

example/main.dart

import 'package:http/http.dart' as http;
import 'package:webfeed/webfeed.dart';

void main() {
  var client = new http.Client();

  // RSS feed
  client.get("https://developer.apple.com/news/releases/rss/releases.rss").then((response) {
    return response.body;
  }).then((bodyString) {
    var channel = new RssFeed.parse(bodyString);
    print(channel);
    return channel;
  });

  // Atom feed
  client.get("https://www.theverge.com/rss/index.xml").then((response) {
    return response.body;
  }).then((bodyString) {
    var feed = new AtomFeed.parse(bodyString);
    print(feed);
    return feed;
  });
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  webfeed: ^0.4.1

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:webfeed/webfeed.dart';
  
Version Uploaded Documentation Archive
0.4.1 Dec 3, 2018 Go to the documentation of webfeed 0.4.1 Download webfeed 0.4.1 archive
0.4.0 Oct 2, 2018 Go to the documentation of webfeed 0.4.0 Download webfeed 0.4.0 archive
0.3.0 Sep 12, 2018 Go to the documentation of webfeed 0.3.0 Download webfeed 0.3.0 archive
0.2.3 Sep 2, 2018 Go to the documentation of webfeed 0.2.3 Download webfeed 0.2.3 archive
0.2.2 Aug 29, 2018 Go to the documentation of webfeed 0.2.2 Download webfeed 0.2.2 archive
0.2.1 Apr 6, 2018 Go to the documentation of webfeed 0.2.1 Download webfeed 0.2.1 archive
0.2.0 Apr 6, 2018 Go to the documentation of webfeed 0.2.0 Download webfeed 0.2.0 archive
0.1.0 Apr 2, 2018 Go to the documentation of webfeed 0.1.0 Download webfeed 0.1.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
85
Health:
Code health derived from static analysis. [more]
90
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
90
Learn more about scoring.

We analyzed this package on Dec 5, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.7

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:webfeed/webfeed.dart.

Health issues and suggestions

Document public APIs (-9.97 points)

348 out of 349 API elements (library, class, field or method) have no adequate dartdoc content. Good documentation improves code readability and discoverability through search.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
xml ^3.0.0 3.2.3
Transitive dependencies
collection 1.14.11
petitparser 2.0.2
Dev dependencies
http ^0.11.3+16
test ^1.3.0