Coder Social home page Coder Social logo

simplefeedreader's Introduction

Logo SimpleFeedReader

Easy to use, simple, Syndication feed reader (Atom / RSS). Available as Nuget Package.

Usage

var reader = new FeedReader();
var items = reader.RetrieveFeed("http://www.nytimes.com/services/xml/rss/nyt/International.xml");

foreach (var i in items)
    Console.WriteLine($"{i.Date.ToString("g")}\t{i.Title}");

Output:

4/16/2014  4:27 AM     Growth Rose 7.4% in First Quarter, China Reports
4/16/2014 12:29 AM     Milan Court Gives Berlusconi a Year of Community Service
4/15/2014 12:34 PM     Desalination Plant Said to Be Planned for Thirsty Beijing
4/15/2014  7:24 PM     After Prank by Dutch Girl on Twitter, Real Trouble
4/15/2014  4:33 PM     Afghanistan Says NATO Airstrike in East Killed Civilians
4/16/2014 12:49 AM     Iran Escalates Dispute Over U.N. Envoy
...

Notes

By default the FeedReader suppresses exceptions (since feeds tend to go down occasionally, they contain invalid XML from time-to-time and have all other sorts of problems). However, you can tell the FeedReader to throw exceptions simply by setting the throwOnError argument of the FeedReader's constructor to true.

The FeedReader also accepts an optional FeedNormalizer (needs to implement the IFeedItemNormalizer interface). This "normalizer" can transform or otherwise affect the way SyndicationItems are transformed into FeedItems. The FeedItem is the basic object retrieved from feeds and, for simplicity, contains only a few simple properties and methods. It has Title, Summary, Content, Uri , PublishDate, LastUpdatedDate, Images and Categories properties and that's about it. The default DefaultFeedItemNormalizer strips and decodes any HTML in the Title, Summary, Content to (try to) reliably return plain text only. The Date property will be populated with whatever the SyndicationItem's latest date is: the PublishDate or LastUpdatedTime.

You can implement your own IFeedItemNormalizer (see the UnitTest project for examples) to handle 'normalization' differently to your desire. The FeedReader has some convienience methods like RetrieveFeeds() that retrieve more than one feed.

Included in the project is a Sandcastle Helpfile Builder project that creates a helpfile for easy to use documentation.

The project is aimed at easy, don't-make-me-think, retrieval of syndication feeds' entries. It is by no means intended as full-fledged feedreader. It is, however, easily extensible for your purposes (again, see the UnitTest project for examples; the ExtendedFeedItem and ExtendedFeedItemNormalizer are nice concrete examples of this idea).

Build status NuGet version

simplefeedreader's People

Contributors

robthree avatar unickq avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

simplefeedreader's Issues

Proxy settings

I have a question :
What if I'm behind a proxy?
Is there a property to set?

Thanks!

Nuget package is not the latest code

Not an actual issue, but the nuget package v1.0.7 does not have not the latest code as in this repository. I did check your latest commit was on 9th March 2017 and same day published to nuget, but the class FeedItem on nuget does not have property Images (and there might be other differences as well).

Can you update nuget?

PCL support?

Does this work with PCLs, specifically PCL profile 78? That's the default profile used by Xamarin.Forms apps.

I can add it via Nuget with no errors, but I don't think it worked. I can't add a using statement for it, and can't find the FeedReader() constructor.

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.