Giter Club home page Giter Club logo

feedparser's Introduction

feedparser

pub package Build Status

A Dart library for parsing RSS feeds.

Usage

import 'package:feedparser/feedparser.dart';

void main() {
  Feed feed = parse(r'''
    <?xml version="1.0" encoding="UTF-8"?>
    <rss version="2.0">
      <channel>
        <title>Hello World!</title>      
        <description>Parse RSS feeds in Dart with feedparser</description>
      </channel>
    </rss>
  ''');

  print(feed);

  // Output:
  //    title: Hello World!
  //    link: null
  //    description: Parse RSS feeds in Dart with feedparser
  //    language: null
  //    copyright: null
  //    pubDate: null
  //    lastBuildDate: null
  //    image: null
  //    items: []
}

Strict mode

As long as the input string provided is a valid XML string, feedparser will attempt to parse it and return a Feed object. In strict mode feedparser instead throws ArgumentErrors for missing mandatory fields [as defined by the RSS 2.0 spec]. This is useful for testing feeds to ensure they meet the spec, but impractical when dealing with feeds not under your control.

  Feed feed = parse(xmlString, strict: true);

feedparser's People

Contributors

axispx avatar xqwzts avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

feedparser's Issues

Parsing Robustness on YouTube and Blogger RSS feeds

Finding the package working well for 'valid' feeds with XML.

However having issues with some popular RSS providers:
http://returnofthebeast.blogspot.com/feeds/posts/default?alt=rss
https://www.youtube.com/feeds/videos.xml?channel_id=UCspFbd1b1vwuhsj0ZVehd2w

Issue is more with the underlying XML package rather than feedparser going by the stacktrace:

SEVERE 2018-02-02 20:49:59.507736 Invalid argument(s): </ expected at 11:1
SEVERE 2018-02-02 20:49:59.508591 #0 parse (package:xml/xml.dart:42:5)
#1 parse (package:feedparser/src/parser.dart:20:32)
#2 RssWatcher.parseFeed (package:dplanet/rss/rsswatcher.dart:101:20)
#3 RssWatcher.checkForUpdate (package:dplanet/rss/rsswatcher.dart:74:25)

#4 RssWatcher.checkAll (package:dplanet/rss/rsswatcher.dart:54:7)

#5 main (file:///home/daftspaniel/development/WebstormProjects/dplanet/bin/main.dart:12:14)

#6 _startIsolate. (dart:isolate-patch/isolate_patch.dart:263)
#7 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:151)

Thanks!

Version solving failed

I can't add that package:

The current Dart SDK version is 2.1.0-dev.1.0.flutter-ccb16f7282.

Because flutter_rss_reader depends on feedparser any which requires SDK version >=1.21.0 <2.0.0, version solving failed.

It's happened after last commit, so i dont know what to do with...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.