webfeed 0.4.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 88

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]
92
Health:
Code health derived from static analysis. [more]
74
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
88
Learn more about scoring.

We analyzed this package on Jan 19, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.0
  • pana: 0.13.4

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.

Fix lib/domain/media/media.dart. (-10.44 points)

Analysis of lib/domain/media/media.dart reported 22 hints, including:

line 81 col 12: Unnecessary new keyword.

line 82 col 14: Unnecessary new keyword.

line 86 col 16: Unnecessary new keyword.

line 89 col 16: Unnecessary new keyword.

line 91 col 17: Unnecessary new keyword.

Fix lib/domain/media/group.dart. (-2.48 points)

Analysis of lib/domain/media/group.dart reported 5 hints:

line 25 col 12: Unnecessary new keyword.

line 27 col 16: Unnecessary new keyword.

line 30 col 16: Unnecessary new keyword.

line 32 col 17: Unnecessary new keyword.

line 35 col 15: Unnecessary new keyword.

Fix lib/domain/media/community.dart. (-1.99 points)

Analysis of lib/domain/media/community.dart reported 4 hints:

line 22 col 12: Unnecessary new keyword.

line 23 col 19: Unnecessary new keyword.

line 26 col 19: Unnecessary new keyword.

line 29 col 13: Unnecessary new keyword.

Fix additional 26 files with analysis or formatting issues. (-13.50 points)

Additional issues in the following files:

  • lib/domain/media/embed.dart (2 hints)
  • lib/domain/atom_feed.dart (1 hint)
  • lib/domain/atom_generator.dart (1 hint)
  • lib/domain/media/category.dart (1 hint)
  • lib/domain/media/content.dart (1 hint)
  • lib/domain/media/copyright.dart (1 hint)
  • lib/domain/media/credit.dart (1 hint)
  • lib/domain/media/description.dart (1 hint)
  • lib/domain/media/hash.dart (1 hint)
  • lib/domain/media/license.dart (1 hint)
  • lib/domain/media/param.dart (1 hint)
  • lib/domain/media/peer_link.dart (1 hint)
  • lib/domain/media/player.dart (1 hint)
  • lib/domain/media/price.dart (1 hint)
  • lib/domain/media/rating.dart (1 hint)
  • lib/domain/media/restriction.dart (1 hint)
  • lib/domain/media/rights.dart (1 hint)
  • lib/domain/media/scene.dart (1 hint)
  • lib/domain/media/star_rating.dart (1 hint)
  • lib/domain/media/statistics.dart (1 hint)
  • lib/domain/media/status.dart (1 hint)
  • lib/domain/media/tags.dart (1 hint)
  • lib/domain/media/text.dart (1 hint)
  • lib/domain/media/thumbnail.dart (1 hint)
  • lib/domain/media/title.dart (1 hint)
  • lib/domain/rss_content.dart (1 hint)

Dependencies

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