How to use
How do you use it?
Last updated
How do you use it?
Last updated
Using this library is very simple! Just use the Syndian.Instance
namespace in any piece of code you want to use the library, as in: using Syndian.Instance;
First, create a new instance of the RSSFeed
class that contains the necessary constructor.
Then, call either Refresh()
or RefreshAsync()
to get the latest information about your feed, depending on the scenario. If you're either doing web development, or you're developing in an asynchronous program, call the RefreshAsync()
function where appropriate.
The constructor provides the following required arguments:
FeedUrl
: specifies the URL to the RSS feed, for example,
FeedType
: specifies the feed type to parse
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
For the RSS feed info, RSSFeed
contains the following properties:
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
FeedArticles is a list of feed articles, RSSArticle
, that you can enumerate within the for loop, for example:
This class contains the following properties:
ArticleTitle
: Title of the article
ArticleLink
: Link to the article
ArticleDescription
: Description or summary of the article
ArticleVariables
: Additional article parameters