webfeed 0.4.2

WebFeed #

Build Status Pub

A dart package for parsing RSS and Atom feed.

Features #

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

Installing #

Add this line into your pubspec.yaml

webfeed: ^0.4.2

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.2 #

Fixed #

  • Bad import in rss_content.dart & rss_source.dart

0.4.1 #

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.2

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub 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';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
90
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
95
Learn more about scoring.

We analyzed this package on Sep 20, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.0
  • pana: 0.12.21

Platforms

Detected platforms: Flutter, web, other

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

Health issues and suggestions

Document public APIs. (-0.92 points)

390 out of 391 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
xml ^3.0.0 3.5.0
Transitive dependencies
charcode 1.1.2
collection 1.14.12
convert 2.1.1
meta 1.1.7
petitparser 2.4.0
typed_data 1.1.6
Dev dependencies
http ^0.11.3+16
test ^1.3.0