using System; namespace PolyFeed { public enum SourceType { HTML, XML, JSON }; public class FeedSource { /// /// The url of the source document to parse. /// /// The URL. public string Url { get; set; } /// /// The type of source document to expect. /// public SourceType SourceType { get; set; } /// /// The title of the feed. /// Supports the same {} syntax as . /// public string Title { get; set; } /// /// The subtitle of the feed. /// Supports the same {} syntax as . /// /// The subtitle. public string Subtitle { get; set; } #region Entries /// /// A selector that matches against an element that contains the URL that an /// entry should link to. /// Relative to the element selected by . /// public string EntryUrlSelector { get; set; } /// /// The name of the attribute on the element selected by . /// Set to an empty string to select the content of the element instead of the /// content of an attribute. /// public string EntryUrlAttribute { get; set; } = ""; /// /// The selector that specifies the location of nodes in the object model that /// should be added to the feed. /// The format varies depending on the . /// - HTML: CSS selector (e.g. main > article) /// - XML: XPath (e.g. //element_name) /// - JSON: Dotted object (e.g. items.fruit) /// public string EntrySelector { get; set; } /// /// The title of an entry. /// Selectors may be included in curly braces {} to substitute in content. /// Such selectors are relative to the current feed entry. /// The format varies in the samem way as does. /// public string EntryTitle { get; set; } /// /// Same as , but for the body of an entry. HTML is allowed. /// public string EntryContent { get; set; } /// /// The selector for the node that contains the date published for an entry. /// public string EntryPublishedSelector { get; set; } /// /// The name of the attribute that contains the date published for an entry. /// Set to to use the content of the node itself. /// public string EntryPublishedAttribute { get; set; } /// /// Same as , but for the last updated. /// If not specified, the last updated will be omitted. /// public string EntryLastUpdatedSelector { get; set; } /// /// Same as . /// public string EntryLastUpdatedAttribute { get; set; } #endregion } }