Safe Haskell | None |
---|---|
Language | Haskell2010 |
RSS is an XML dialect for Web content syndication.
Example:
<?xml version="1.0"?> <rss version="2.0"> <channel> <title>Liftoff News</title> <link>http://liftoff.msfc.nasa.gov/</link> <description>Liftoff to Space Exploration.</description> <language>en-us</language> <pubDate>Tue, 10 Jun 2003 04:00:00 GMT</pubDate> <lastBuildDate>Tue, 10 Jun 2003 09:41:01 GMT</lastBuildDate> <docs>http://blogs.law.harvard.edu/tech/rss</docs> <generator>Weblog Editor 2.0</generator> <managingEditor>editor@example.com</managingEditor> <webMaster>webmaster@example.com</webMaster> <item> <title>Star City</title> <link>http://liftoff.msfc.nasa.gov/news/2003/news-starcity.asp</link> <description>How do Americans get ready to work with Russians aboard the International Space Station? They take a crash course in culture, language and protocol at Russia's <a href="http://howe.iki.rssi.ru/GCTC/gctc_e.htm">Star City</a>.</description> <pubDate>Tue, 03 Jun 2003 09:39:21 GMT</pubDate> <guid>http://liftoff.msfc.nasa.gov/2003/06/03.html#item573</guid> </item> </channel> </rss>
- data RssException
- data RssURI = RssURI (URIRef a)
- withRssURI :: (forall a. URIRef a -> b) -> RssURI -> b
- data RssCategory = RssCategory {}
- data RssEnclosure = RssEnclosure {}
- data RssSource = RssSource {
- sourceUrl :: RssURI
- sourceName :: Text
- data RssGuid
- data RssItem extensions = RssItem {
- itemTitle :: Text
- itemLink :: Maybe RssURI
- itemDescription :: Text
- itemAuthor :: Text
- itemCategories :: [RssCategory]
- itemComments :: Maybe RssURI
- itemEnclosure :: [RssEnclosure]
- itemGuid :: Maybe RssGuid
- itemPubDate :: Maybe UTCTime
- itemSource :: Maybe RssSource
- itemExtensions :: RssItemExtensions extensions
- type RssItem' = RssItem '[]
- data RssTextInput = RssTextInput {}
- data CloudProtocol
- data RssCloud = RssCloud {}
- data RssImage = RssImage {
- imageUri :: RssURI
- imageTitle :: Text
- imageLink :: RssURI
- imageWidth :: Maybe Int
- imageHeight :: Maybe Int
- imageDescription :: Text
- newtype Hour = Hour Int
- asHour :: MonadThrow m => Int -> m Hour
- data Day
- asDay :: MonadThrow m => Text -> m Day
- data RssDocument extensions = RssDocument {
- documentVersion :: Version
- channelTitle :: Text
- channelLink :: RssURI
- channelDescription :: Text
- channelItems :: [RssItem extensions]
- channelLanguage :: Text
- channelCopyright :: Text
- channelManagingEditor :: Text
- channelWebmaster :: Text
- channelPubDate :: Maybe UTCTime
- channelLastBuildDate :: Maybe UTCTime
- channelCategories :: [RssCategory]
- channelGenerator :: Text
- channelDocs :: Maybe RssURI
- channelCloud :: Maybe RssCloud
- channelTtl :: Maybe Int
- channelImage :: Maybe RssImage
- channelRating :: Text
- channelTextInput :: Maybe RssTextInput
- channelSkipHours :: Set Hour
- channelSkipDays :: Set Day
- channelExtensions :: RssChannelExtensions extensions
- type RssDocument' = RssDocument '[]
- data family RssChannelExtension extensionTag :: *
- data family RssItemExtension extensionTag :: *
- data family RssChannelExtensions (extensionTags :: [*]) :: *
- data family RssItemExtensions (extensionTags :: [*]) :: *
RSS core
data RssException Source #
withRssURI :: (forall a. URIRef a -> b) -> RssURI -> b Source #
data RssCategory Source #
The <category>
element.
data RssEnclosure Source #
The <enclosure>
element.
The <source>
element.
RssSource | |
|
The <guid>
element.
data RssItem extensions Source #
The <item>
element.
This type is open to extensions.
RssItem | |
|
data CloudProtocol Source #
The <cloud>
element.
The <image>
element.
RssImage | |
|
data RssDocument extensions Source #
The <rss>
element.
This type is open to extensions.
RssDocument | |
|
(Eq (RssChannelExtensions e), Eq (RssItemExtensions e)) => Eq (RssDocument e) Source # | |
(Ord (RssChannelExtensions e), Ord (RssItemExtensions e)) => Ord (RssDocument e) Source # | |
(Show (RssChannelExtensions e), Show (RssItemExtensions e)) => Show (RssDocument e) Source # | |
(Generic (RssChannelExtensions e), Generic (RssItemExtensions e)) => Generic (RssDocument e) Source # | |
type Rep (RssDocument e) Source # | |
type RssDocument' = RssDocument '[] Source #
Alias for RssDocument
with no RSS extensions.
RSS extensions
To implement an RSS extension:
- Create a void data-type, that will be used as a tag to identify the extension:
data MyExtension :: *
- Implement extension types for
<channel>
and<item>
elements:
data instance RssChannelExtension MyExtension = MyExtensionChannel { {- ... fields -} } data instance RssItemExtension MyExtension = MyExtensionItem { {- ... fields -} }
- Implement corresponding parsers (cf Text.RSS.Extensions).
data family RssChannelExtension extensionTag :: * Source #
<channel>
extension type.
data family RssItemExtension extensionTag :: * Source #
<item>
extension type.
data family RssChannelExtensions (extensionTags :: [*]) :: * Source #
Combination of multiple <channel>
extensions.
Eq (Rec * RssChannelExtension a) => Eq (RssChannelExtensions a) Source # | |
Ord (Rec * RssChannelExtension a) => Ord (RssChannelExtensions a) Source # | |
Show (Rec * RssChannelExtension a) => Show (RssChannelExtensions a) Source # | |
Generic (Rec * RssChannelExtension a) => Generic (RssChannelExtensions a) Source # | |
data RssChannelExtensions Source # | |
type Rep (RssChannelExtensions a) Source # | |
data family RssItemExtensions (extensionTags :: [*]) :: * Source #
Combination of multiple <item>
extensions.
Eq (Rec * RssItemExtension a) => Eq (RssItemExtensions a) Source # | |
Ord (Rec * RssItemExtension a) => Ord (RssItemExtensions a) Source # | |
Show (Rec * RssItemExtension a) => Show (RssItemExtensions a) Source # | |
Generic (Rec * RssItemExtension a) => Generic (RssItemExtensions a) Source # | |
data RssItemExtensions Source # | |
type Rep (RssItemExtensions a) Source # | |