universal_feed library
Library to parse RSS and Atom feeds. It includes support for RSS from version 0.90 to 2.0 and Atom 0.3 and 1.0.
Out-of-the-box has support for some common extensions like:
- Dublin Core
- Dublin Core Terms
- Geo RSS
- Media RSS
- Syndication
- Itunes
This library makes no assumptions about the data parsed and tries to be quite liberal in reading the feed's content. For example, with time stamps, there is no attempt to parse it when the feed is parsed. The Timestamp object has methods to help with the parsing.
Classes
- Author
- Person/Entity that indicates the author of the entry or feed.
- Category
- Holds information about a category associated to an entry or feed
- Content
- Element either contains or links to the content of the entry.
- Credit
- Hols the contribution to the creation of the media object.
- DcTerms
- DcTerms is an extension to Dublin core
- Enclosure
- Media object attached to an entry, usually a binary object (image, sound, video) It has three required attributes. url says where the enclosure is located, length says how big it is in bytes, and type says what its type is, a standard MIME type.
- Generator
- Identifies the agent used to generate a feed, for debugging and other purposes.
- Geo
- Geo Spec
- Image
- Information related to an image attached to an entry or feed.
- Item
- An item in a feed
- ItunesChannel
- Itunes Channel information
- ItunesItem
- Singe Itunes item
- Link
- A Link is a reference from one Web resource to another.
- Media
- An RSS module that supplements the
- MediaContent
- An RSS module that supplements the
- MetaData
- Metadata information related to the feed
- Namespaces
- Namespaces keeps track of the namespaces defined on the feed
- ParseInfo
- ParseInfo handles parse information for each type of date format supported
- Player
- Allows the media object to be accessed through a web browser media player console.
- Rating
- This allows the permissible audience to be declared. If this element is not included, it assumes that no restrictions are necessary.
- Syndication
- Provides syndication hints to aggregators and others picking up this RDF Site Summary (RSS) feed regarding how often it is updated. For example, if you updated your file twice an hour, updatePeriod would be "hourly" and updateFrequency would be "2". The syndication module borrows from Ian Davis's Open Content Syndication (OCS) directory format. It supersedes the RSS 0.91 skipDay and skipHour elements.
- Timestamp
- Date instances on the feed
- UniversalFeed
- Feed is the root element of the UniversalFeed.
Enums
- AuthorType
-
Parametrized values of the
type
attribute of the Author class - FeedKind
- Supported feed types
- LinkRelationType
- Link Relation Types
Constants
- nsAtomNs → const String
- Atom namespace
- nsContentNs → const String
- Content namespace
- nsDcTermsNs → const String
- DCTerms namespace
- nsDublinCoreNs → const String
- Dublin Core namespace
- nsGeoNs → const String
- GeoRSS namespace
- nsItunesNs → const String
- ITunes Namespace
- nsMediaNs → const String
- RSS Media namespace
- nsSyndicationNs → const String
- Syndication namespace
- rss90ns → const String
- RSS 0.9 URI
- rss91n → const String
- RSS 0.91 URI
Properties
Functions
-
defaultParser(
String value, ParseInfo pi) → DateTime - The default parser will use DateFormat and with a know to parse format
-
parseDate(
String value) → DateTime? - Makes a best effort to parse different date time formats. The returned DateTime will be in UTC
-
parseWithNamedTz(
String value, ParseInfo pi) → DateTime - Parse a DateTime string with a named TZ like PDT
-
parseWithNumericTz(
String value, ParseInfo pi) → DateTime - Parse a dateTime string with a numeric TZ like +300
-
removeEndingZ(
String value) → String - Removes the last character if it is Z
Typedefs
- FormatterCallback = String Function(String value, ParseInfo pi)
- Callback used to preformat the DateTime string before send to the formatter
- ParserCallback = DateTime Function(String value, ParseInfo pi)
- Callback used by ParseInfo to parse custom DateTime formats
Exceptions / Errors
- FeedError
- Exception used for generic errors
- FeedParseError
- Exception used when an errors is found parsing the feed