Text.RSS.Syntax

feed-0.3.11.1: Interfacing with RSS (v 0.9x, 2.x, 1.0) + Atom feeds.

Copyright | (c) Galois, Inc. 2008, (c) Sigbjorn Finne 2009-
License | BSD3
Maintainer | Sigbjorn Finne <sof@forkIO.com>
Stability | provisional
Safe Haskell | Safe
Language | Haskell98

Text.RSS.Syntax

Description

The basic syntax for putting together feeds.

For instance, to create a feed with a single item item: (nullRSS "rss title" "link") {rssChannel=(nullChannel "channel title" "link") {rssItems=[(nullItem "item title")]}}

Synopsis

- data RSS = RSS {
  - rssVersion :: String
  - rssAttrs :: [Attr]
  - rssChannel :: RSSChannel
  - rssOther :: [Element]
  }
- type URLString = String
- type DateString = String
- data RSSChannel = RSSChannel {
  - rssTitle :: String
  - rssLink :: URLString
  - rssDescription :: String
  - rssItems :: [RSSItem]
  - rssLanguage :: Maybe String
  - rssCopyright :: Maybe String
  - rssEditor :: Maybe String
  - rssWebMaster :: Maybe String
  - rssPubDate :: Maybe DateString
  - rssLastUpdate :: Maybe DateString
  - rssCategories :: [RSSCategory]
  - rssGenerator :: Maybe String
  - rssDocs :: Maybe URLString
  - rssCloud :: Maybe RSSCloud
  - rssTTL :: Maybe Integer
  - rssImage :: Maybe RSSImage
  - rssRating :: Maybe String
  - rssTextInput :: Maybe RSSTextInput
  - rssSkipHours :: Maybe [Integer]
  - rssSkipDays :: Maybe [String]
  - rssChannelOther :: [Element]
  }
- data RSSItem = RSSItem {
  - rssItemTitle :: Maybe String
  - rssItemLink :: Maybe URLString
  - rssItemDescription :: Maybe String
  - rssItemAuthor :: Maybe String
  - rssItemCategories :: [RSSCategory]
  - rssItemComments :: Maybe URLString
  - rssItemEnclosure :: Maybe RSSEnclosure
  - rssItemGuid :: Maybe RSSGuid
  - rssItemPubDate :: Maybe DateString
  - rssItemSource :: Maybe RSSSource
  - rssItemAttrs :: [Attr]
  - rssItemOther :: [Element]
  }
- data RSSSource = RSSSource {
  - rssSourceURL :: URLString
  - rssSourceAttrs :: [Attr]
  - rssSourceTitle :: String
  }
- data RSSEnclosure = RSSEnclosure {
  - rssEnclosureURL :: URLString
  - rssEnclosureLength :: Maybe Integer
  - rssEnclosureType :: String
  - rssEnclosureAttrs :: [Attr]
  }
- data RSSCategory = RSSCategory {
  - rssCategoryDomain :: Maybe String
  - rssCategoryAttrs :: [Attr]
  - rssCategoryValue :: String
  }
- data RSSGuid = RSSGuid {
  - rssGuidPermanentURL :: Maybe Bool
  - rssGuidAttrs :: [Attr]
  - rssGuidValue :: String
  }
- data RSSImage = RSSImage {
  - rssImageURL :: URLString
  - rssImageTitle :: String
  - rssImageLink :: URLString
  - rssImageWidth :: Maybe Integer
  - rssImageHeight :: Maybe Integer
  - rssImageDesc :: Maybe String
  - rssImageOther :: [Element]
  }
- data RSSCloud = RSSCloud {
  - rssCloudDomain :: Maybe String
  - rssCloudPort :: Maybe String
  - rssCloudPath :: Maybe String
  - rssCloudRegisterProcedure :: Maybe String
  - rssCloudProtocol :: Maybe String
  - rssCloudAttrs :: [Attr]
  }
- data RSSTextInput = RSSTextInput {
  - rssTextInputTitle :: String
  - rssTextInputDesc :: String
  - rssTextInputName :: String
  - rssTextInputLink :: URLString
  - rssTextInputAttrs :: [Attr]
  - rssTextInputOther :: [Element]
  }
- nullRSS :: String -> URLString -> RSS
- nullChannel :: String -> URLString -> RSSChannel
- nullItem :: String -> RSSItem
- nullSource :: URLString -> String -> RSSSource
- nullEnclosure :: URLString -> Maybe Integer -> String -> RSSEnclosure
- newCategory :: String -> RSSCategory
- nullGuid :: String -> RSSGuid
- nullPermaGuid :: String -> RSSGuid
- nullImage :: URLString -> String -> URLString -> RSSImage
- nullCloud :: RSSCloud
- nullTextInput :: String -> String -> URLString -> RSSTextInput

# Documentation

data RSS #

Constructors

RSS |
Fields rssVersion :: String rssAttrs :: [Attr] rssChannel :: RSSChannel rssOther :: [Element]

Instances

Show RSS # |
Methods showsPrec :: Int -> RSS -> ShowS # show :: RSS -> String # showList :: [RSS] -> ShowS #

type URLString = String #

type DateString = String #

RFC 822 conforming.

data RSSChannel #

Constructors

RSSChannel |
Fields rssTitle :: String rssLink :: URLString rssDescription :: String rssItems :: [RSSItem] rssLanguage :: Maybe String rssCopyright :: Maybe String rssEditor :: Maybe String rssWebMaster :: Maybe String rssPubDate :: Maybe DateString rfc 822 conforming. rssLastUpdate :: Maybe DateString rfc 822 conforming. rssCategories :: [RSSCategory] rssGenerator :: Maybe String rssDocs :: Maybe URLString rssCloud :: Maybe RSSCloud rssTTL :: Maybe Integer rssImage :: Maybe RSSImage rssRating :: Maybe String rssTextInput :: Maybe RSSTextInput rssSkipHours :: Maybe [Integer] rssSkipDays :: Maybe [String] rssChannelOther :: [Element]

Instances

Show RSSChannel # |
Methods showsPrec :: Int -> RSSChannel -> ShowS # show :: RSSChannel -> String # showList :: [RSSChannel] -> ShowS #

data RSSItem #

Constructors

RSSItem |
Fields rssItemTitle :: Maybe String rssItemLink :: Maybe URLString rssItemDescription :: Maybe String if not present, the title is. (per spec, at least.) rssItemAuthor :: Maybe String rssItemCategories :: [RSSCategory] rssItemComments :: Maybe URLString rssItemEnclosure :: Maybe RSSEnclosure rssItemGuid :: Maybe RSSGuid rssItemPubDate :: Maybe DateString rssItemSource :: Maybe RSSSource rssItemAttrs :: [Attr] rssItemOther :: [Element]

Instances

Show RSSItem # |
Methods showsPrec :: Int -> RSSItem -> ShowS # show :: RSSItem -> String # showList :: [RSSItem] -> ShowS #

data RSSSource #

Constructors

RSSSource |
Fields rssSourceURL :: URLString rssSourceAttrs :: [Attr] rssSourceTitle :: String

Instances

Show RSSSource # |
Methods showsPrec :: Int -> RSSSource -> ShowS # show :: RSSSource -> String # showList :: [RSSSource] -> ShowS #

data RSSEnclosure #

Constructors

RSSEnclosure |
Fields rssEnclosureURL :: URLString rssEnclosureLength :: Maybe Integer rssEnclosureType :: String rssEnclosureAttrs :: [Attr]

Instances

Show RSSEnclosure # |
Methods showsPrec :: Int -> RSSEnclosure -> ShowS # show :: RSSEnclosure -> String # showList :: [RSSEnclosure] -> ShowS #

data RSSCategory #

Constructors

RSSCategory |
Fields rssCategoryDomain :: Maybe String rssCategoryAttrs :: [Attr] rssCategoryValue :: String

Instances

Show RSSCategory # |
Methods showsPrec :: Int -> RSSCategory -> ShowS # show :: RSSCategory -> String # showList :: [RSSCategory] -> ShowS #

data RSSGuid #

Constructors

RSSGuid |
Fields rssGuidPermanentURL :: Maybe Bool rssGuidAttrs :: [Attr] rssGuidValue :: String

Instances

Show RSSGuid # |
Methods showsPrec :: Int -> RSSGuid -> ShowS # show :: RSSGuid -> String # showList :: [RSSGuid] -> ShowS #

data RSSImage #

Constructors

RSSImage |
Fields rssImageURL :: URLString rssImageTitle :: String rssImageLink :: URLString rssImageWidth :: Maybe Integer rssImageHeight :: Maybe Integer rssImageDesc :: Maybe String rssImageOther :: [Element]

Instances

Show RSSImage # |
Methods showsPrec :: Int -> RSSImage -> ShowS # show :: RSSImage -> String # showList :: [RSSImage] -> ShowS #

data RSSCloud #

Constructors

RSSCloud |
Fields rssCloudDomain :: Maybe String rssCloudPort :: Maybe String rssCloudPath :: Maybe String rssCloudRegisterProcedure :: Maybe String rssCloudProtocol :: Maybe String rssCloudAttrs :: [Attr]

Instances

Show RSSCloud # |
Methods showsPrec :: Int -> RSSCloud -> ShowS # show :: RSSCloud -> String # showList :: [RSSCloud] -> ShowS #

data RSSTextInput #

Constructors

RSSTextInput |
Fields rssTextInputTitle :: String rssTextInputDesc :: String rssTextInputName :: String rssTextInputLink :: URLString rssTextInputAttrs :: [Attr] rssTextInputOther :: [Element]

Instances

Show RSSTextInput # |
Methods showsPrec :: Int -> RSSTextInput -> ShowS # show :: RSSTextInput -> String # showList :: [RSSTextInput] -> ShowS #

nullRSS #

Arguments

:: String | channel title
-> URLString | channel link
-> RSS |

nullChannel #

Arguments

:: String | rssTitle
-> URLString | rssLink
-> RSSChannel |

nullItem #

Arguments

:: String | title
-> RSSItem |

nullSource #

Arguments

:: URLString | source URL
-> String | title
-> RSSSource |

nullEnclosure #

Arguments

:: URLString | enclosure URL
-> Maybe Integer | enclosure length
-> String | enclosure type
-> RSSEnclosure |

newCategory #

Arguments

:: String | category Value
-> RSSCategory |

nullGuid #

Arguments

:: String | guid value
-> RSSGuid |

nullPermaGuid #

Arguments

:: String | guid value
-> RSSGuid |

nullImage #

Arguments

:: URLString | imageURL
-> String | imageTitle
-> URLString | imageLink
-> RSSImage |

nullCloud :: RSSCloud #

nullTextInput #

Arguments

:: String | inputTitle
-> String | inputName
-> URLString | inputLink
-> RSSTextInput |