webfeed 0.2.1

  • README.md
  • Example
  • Installing
  • Versions
  • 73

WebFeed

Build Status Pub

A dart package for parsing RSS and Atom feed.

Features

  • [x] RSS
  • [x] Atom
  • [ ] JSON

Installing

Add this line into your pubspec.yaml

webfeed: ^0.2.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.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

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

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

License

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

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

Analysis

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

  • Dart: 2.0.0-dev.63.0
  • pana: 0.11.3

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
54 / 100
Health:
Code health derived from static analysis. [more]
99 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80 / 100
Overall score:
Weighted score of the above. [more]
73
Learn more about scoring.

Platforms

Detected platforms: Flutter, web, other

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

Suggestions

  • Maintain CHANGELOG.md.

    Changelog entries help clients to follow the progress in your code.

  • The description is too short.

    Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 5 hints.

    Run dartfmt to format lib/domain/atom_feed.dart.

    Run dartfmt to format lib/domain/atom_link.dart.

    Similar analysis of the following files failed:

    • lib/domain/rss_cloud.dart (hint)
    • lib/domain/rss_feed.dart (hint)
    • lib/domain/rss_item.dart (hint)

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.8.0 <2.0.0
xml ^3.0.0 3.0.0
Transitive dependencies
collection 1.14.10
matcher 0.12.3
path 1.6.1
petitparser 1.7.6
stack_trace 1.9.2
Dev dependencies
http ^0.11.3+16
test ^0.12.0