dart_rss 1.0.2+1

  • Readme
  • Changelog
  • Example
  • Installing
  • 71

Dart RSS #

Build Status Pub

A dart package for parsing RSS1.0 / RSS2.0 / Atom feed.

Features #

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

Installing #

Add this line into your pubspec.yaml

dart_rss: ^1.0.1

Import the package into your dart code using:

import 'package:dart_rss/dart_rss.dart';

Example #

To parse string into RssFeed object use:

var rssFeed = new RssFeed.parse(xmlString); // for parsing RSS 2.0 feed
var atomFeed = new AtomFeed.parse(xmlString); // for parsing Atom feed
var rss1Feed = new RssFeed.parse(xmlString); // for parsing RSS 1.0 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

RSS 1.0

feed.title
feed.description
feed.link
feed.items
feed.image
feed.updatePeriod
feed.updateFrequency
feed.updateBase
feed.dc

RssItem item = feed.items.first;
item.title
item.description
item.link
item.dc
item.content

License #

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

Thanks #

This package is forked from WebFeed.

Changelog #

1.0.2+1 #

Fix #

  • upgrade intl package.

1.0.2 #

Add #

  • support American Style Format DateTime.
  • add some real RSS tests.

Refactor #

  • split methods.

1.0.1+1 #

Change #

  • modify some dependencies.

1.0.1 #

Add ✨ #

  • This is the first release.

Note 📝 #

example/main.dart

import 'package:http/http.dart' as http;
import 'package:dart_rss/dart_rss.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:
  dart_rss: ^1.0.2+1

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:dart_rss/dart_rss.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
69
Health:
Code health derived from static analysis. [more]
74
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
70
Overall:
Weighted score of the above. [more]
71
Learn more about scoring.

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

  • Dart: 2.8.2
  • pana: 0.13.8-dev

Health issues and suggestions

Document public APIs. (-0.66 points)

513 out of 519 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 30 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)
  • lib/domain/rss_item_itunes.dart (Run dartfmt to format lib/domain/rss_item_itunes.dart.)
  • lib/domain/rss_itunes.dart (Run dartfmt to format lib/domain/rss_itunes.dart.)
  • lib/domain/rss_itunes_category.dart (Run dartfmt to format lib/domain/rss_itunes_category.dart.)
  • lib/domain/rss_itunes_episode_type.dart (Run dartfmt to format lib/domain/rss_itunes_episode_type.dart.)

Maintenance issues and suggestions

Support latest dependencies. (-20 points)

The version constraint in pubspec.yaml does not support the latest published versions for 2 dependencies (http, xml).

The description is too long. (-10 points)

Search engines display only the first part of the description. Try to keep the value of the description field in your package's pubspec.yaml file between 60 and 180 characters.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.6.0 <3.0.0
http ^0.11.0 0.11.3+17 0.12.1
intl ^0.16.0 0.16.1
meta ^1.0.0 1.1.8
xml ^3.0.0 3.7.0 4.2.0
Transitive dependencies
async 2.4.1
charcode 1.1.3
collection 1.14.12
convert 2.1.1
http_parser 3.1.4
path 1.7.0
petitparser 3.0.4
source_span 1.7.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
Dev dependencies
test ^1.0.0