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

# Documentation

data RSS Source #

Constructors

RSS |

Fields

- rssVersion :: Text
- rssAttrs :: [Attr]
- rssChannel :: RSSChannel
- rssOther :: [Element]

#### Instances

Instances details

Show RSS Source # |
Instance details Defined in Text.RSS.Syntax Methods showsPrec :: Int -> RSS -> ShowS show :: RSS -> String showList :: [RSS] -> ShowS

type URLString = Text Source #

type DateString = Text Source #

RFC 822 conforming.

data RSSChannel Source #

Constructors

RSSChannel |

Fields

- rssTitle :: Text
- rssLink :: URLString
- rssDescription :: Text
- rssItems :: [RSSItem]
- rssLanguage :: Maybe Text
- rssCopyright :: Maybe Text
- rssEditor :: Maybe Text
- rssWebMaster :: Maybe Text
- rssPubDate :: Maybe DateString

  rfc 822 conforming.

- rssLastUpdate :: Maybe DateString

  rfc 822 conforming.

- rssCategories :: [RSSCategory]
- rssGenerator :: Maybe Text
- rssDocs :: Maybe URLString
- rssCloud :: Maybe RSSCloud
- rssTTL :: Maybe Integer
- rssImage :: Maybe RSSImage
- rssRating :: Maybe Text
- rssTextInput :: Maybe RSSTextInput
- rssSkipHours :: Maybe [Integer]
- rssSkipDays :: Maybe [Text]
- rssChannelOther :: [Element]

#### Instances

Instances details

Show RSSChannel Source # |
Instance details Defined in Text.RSS.Syntax Methods showsPrec :: Int -> RSSChannel -> ShowS show :: RSSChannel -> String showList :: [RSSChannel] -> ShowS

data RSSItem Source #

Constructors

RSSItem |

Fields

- rssItemTitle :: Maybe Text
- rssItemLink :: Maybe URLString
- rssItemDescription :: Maybe Text

  if not present, the title is. (per spec, at least.)

- rssItemAuthor :: Maybe Text
- rssItemCategories :: [RSSCategory]
- rssItemComments :: Maybe URLString
- rssItemEnclosure :: Maybe RSSEnclosure
- rssItemGuid :: Maybe RSSGuid
- rssItemPubDate :: Maybe DateString
- rssItemSource :: Maybe RSSSource
- rssItemAttrs :: [Attr]
- rssItemOther :: [Element]

#### Instances

Instances details

Show RSSItem Source # |
Instance details Defined in Text.RSS.Syntax Methods showsPrec :: Int -> RSSItem -> ShowS show :: RSSItem -> String showList :: [RSSItem] -> ShowS

data RSSSource Source #

Constructors

RSSSource |

Fields

- rssSourceURL :: URLString
- rssSourceAttrs :: [Attr]
- rssSourceTitle :: Text

#### Instances

Instances details

Show RSSSource Source # |
Instance details Defined in Text.RSS.Syntax Methods showsPrec :: Int -> RSSSource -> ShowS show :: RSSSource -> String showList :: [RSSSource] -> ShowS

data RSSEnclosure Source #

Constructors

RSSEnclosure |

Fields

- rssEnclosureURL :: URLString
- rssEnclosureLength :: Maybe Integer
- rssEnclosureType :: Text
- rssEnclosureAttrs :: [Attr]

#### Instances

Instances details

Show RSSEnclosure Source # |
Instance details Defined in Text.RSS.Syntax Methods showsPrec :: Int -> RSSEnclosure -> ShowS show :: RSSEnclosure -> String showList :: [RSSEnclosure] -> ShowS

data RSSCategory Source #

Constructors

RSSCategory |

Fields

- rssCategoryDomain :: Maybe Text
- rssCategoryAttrs :: [Attr]
- rssCategoryValue :: Text

#### Instances

Instances details

Show RSSCategory Source # |
Instance details Defined in Text.RSS.Syntax Methods showsPrec :: Int -> RSSCategory -> ShowS show :: RSSCategory -> String showList :: [RSSCategory] -> ShowS

data RSSGuid Source #

Constructors

RSSGuid |

Fields

- rssGuidPermanentURL :: Maybe Bool
- rssGuidAttrs :: [Attr]
- rssGuidValue :: Text

#### Instances

Instances details

Show RSSGuid Source # |
Instance details Defined in Text.RSS.Syntax Methods showsPrec :: Int -> RSSGuid -> ShowS show :: RSSGuid -> String showList :: [RSSGuid] -> ShowS

data RSSImage Source #

Constructors

RSSImage |

Fields

- rssImageURL :: URLString
- rssImageTitle :: Text
- rssImageLink :: URLString
- rssImageWidth :: Maybe Integer
- rssImageHeight :: Maybe Integer
- rssImageDesc :: Maybe Text
- rssImageOther :: [Element]

#### Instances

Instances details

Show RSSImage Source # |
Instance details Defined in Text.RSS.Syntax Methods showsPrec :: Int -> RSSImage -> ShowS show :: RSSImage -> String showList :: [RSSImage] -> ShowS

data RSSCloud Source #

Constructors

RSSCloud |

Fields

- rssCloudDomain :: Maybe Text
- rssCloudPort :: Maybe Text
- rssCloudPath :: Maybe Text
- rssCloudRegisterProcedure :: Maybe Text
- rssCloudProtocol :: Maybe Text
- rssCloudAttrs :: [Attr]

#### Instances

Instances details

Show RSSCloud Source # |
Instance details Defined in Text.RSS.Syntax Methods showsPrec :: Int -> RSSCloud -> ShowS show :: RSSCloud -> String showList :: [RSSCloud] -> ShowS

data RSSTextInput Source #

Constructors

RSSTextInput |

Fields

- rssTextInputTitle :: Text
- rssTextInputDesc :: Text
- rssTextInputName :: Text
- rssTextInputLink :: URLString
- rssTextInputAttrs :: [Attr]
- rssTextInputOther :: [Element]

#### Instances

Instances details

Show RSSTextInput Source # |
Instance details Defined in Text.RSS.Syntax Methods showsPrec :: Int -> RSSTextInput -> ShowS show :: RSSTextInput -> String showList :: [RSSTextInput] -> ShowS

nullRSS Source #

Arguments

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

nullChannel Source #

Arguments

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

nullItem Source #

Arguments

:: Text | title
-> RSSItem |

nullSource Source #

Arguments

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

nullEnclosure Source #

Arguments

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

newCategory Source #

Arguments

:: Text | category Value
-> RSSCategory |

nullGuid Source #

Arguments

:: Text | guid value
-> RSSGuid |

nullPermaGuid Source #

Arguments

:: Text | guid value
-> RSSGuid |

nullImage Source #

Arguments

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

nullCloud :: RSSCloud Source #

nullTextInput Source #

Arguments

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