gitlabEdit

newspaperRSS Feeds

News right at your fingertips!

This feature provides a set of functions that allow you to get a list of articles from an RSS feed from a single site.


Usage

If you want to get all RSS feeds from a single site, you can use the RSSTools class from the Nettify.Rss namespace. Just follow the below steps:

1

Creating a new instance

Create a new instance of the RSSFeed class that contains the necessary constructor.

public RSSFeed(string FeedUrl, RSSFeedType FeedType)
2

Refresh the instance to get articles

Call either Refresh() or RefreshAsync() to get the latest information about your feed, depending on the scenario.

circle-info

If you're either doing web development, or you're developing in an asynchronous program, call the RefreshAsync() function where appropriate.


Structure

The RSS feed class contains a structure that is explained when you expand one of the following items.

chevron-rightThe constructorhashtag

The constructor provides the following required arguments:

Argument
Description

FeedUrl

Specifies the URL to the RSS feed, for example, https://www.techrepublic.com/rssfeeds/articles/arrow-up-right

FeedType

Specifies the feed type to parse

chevron-rightFeed typeshashtag

FeedType can be one of the following:

Feed type
Description

RSS2

Assumes that the RSS feed in the given URL is an RSS 2 feed

RSS1

Assumes that the RSS feed in the given URL is an RSS 1 feed

Atom

Assumes that the RSS feed in the given URL is an Atom feed

Infer

Automatically detects the RSS feed type

chevron-rightRSS feed instancehashtag

For the RSS feed info, RSSFeed contains the following properties:

Property
Description

FeedUrl

URL to the feed

FeedType

Feed type as described above

FeedTitle

Feed title provided by the host

FeedDescription

Feed description provided by the host

FeedArticles

List of feed articles

chevron-rightFeed article listhashtag

In the RSS feed instance, FeedArticles is a list of feed articles, RSSArticle, that you can enumerate within the for loop, for example:

This class contains the following properties:

Property
Description

ArticleTitle

Title of the article

ArticleLink

Link to the article

ArticleDescription

Description or summary of the article

ArticleVariables

Additional article parameters


Searching RSS feeds

When it comes to searching RSS feeds, Nettify uses Feedly to give you a functionality that allows you to search Feedly for all the RSS feeds. For instance, if you're searching for Linux using this feature, it'll return all feeds that have to do with Linux. Check out Feedly's website if you don't know what it is yet:

To get articles from the RSS feeds that are found within a search term, follow these steps:

1

Get a list of RSS feed sites

Use one of the following functions:

  • GetRssFeeds()

  • GetRssFeedsAsync()

Once you call one of these functions, you can use this array of SearcherInstance to get information about the resultant feeds.

circle-info

If you're either doing web development, or you're developing in an asynchronous program, call the GetRssFeedsAsync() function where appropriate.

2

Obtain an RSS feed instance from the searcher

Use one of the following functions:

  • GetFeedFromSearcher()

  • GetFeedFromSearcherAsync()

Once you call one of these functions, you can get an instance of RSSFeed that you can use to get articles.

circle-info

If you're either doing web development, or you're developing in an asynchronous program, call the GetFeedFromSearcherAsync() function where appropriate.

If you don't want to obtain an RSS feed from the searcher, you can use it for something else.

chevron-rightSearcher instance propertieshashtag

A SearcherInstance class contains the following properties:

Property
Description

Description

Gets the first line of the description

FullDescription

Gets the whole feed description

Last updated